租金BUG修复
This commit is contained in:
@@ -276,6 +276,7 @@ def calc(city, year_month):
|
||||
diff_df = combined.drop_duplicates(subset=['city', 'region', 'name'], keep=False)
|
||||
actions.clear()
|
||||
for index, item in diff_df.iterrows():
|
||||
try:
|
||||
location = {
|
||||
"type": "Point",
|
||||
"coordinates": [item['lng'] / math.pow(10, 10), item['lat'] / math.pow(10, 10)]
|
||||
@@ -283,7 +284,7 @@ def calc(city, year_month):
|
||||
city = item['city']
|
||||
region = item['region']
|
||||
name = item['name']
|
||||
estate_type2 = item['estate_type2']
|
||||
estate_type2 = item['estate_type2'] if pd.notna(item['estate_type2']) else None
|
||||
bed_kind = item['bed_kind']
|
||||
ret = office_rent_stat_conn.aggregate([
|
||||
{
|
||||
@@ -303,6 +304,9 @@ def calc(city, year_month):
|
||||
'$limit': 5
|
||||
}
|
||||
]);
|
||||
except Exception as e:
|
||||
print("Error occurred:", str(e))
|
||||
print(item)
|
||||
# 提取 avg_price 的值
|
||||
avg_prices = [doc["avg_price"] for doc in ret]
|
||||
# 计算平均值
|
||||
|
||||
Reference in New Issue
Block a user