新增写字楼出售价格重算

This commit is contained in:
沈健
2025-06-10 15:31:57 +08:00
parent cb938f81f0
commit df71f89b07
3 changed files with 216 additions and 127 deletions
+2 -2
View File
@@ -102,10 +102,10 @@ def calcByOffice(city, district, office_name):
# 计算平均值
average_price = np.mean(avg_prices) if len(avg_prices) > 0 else 0
if average_price > 0:
new_avg_price = average_price
new_avg_price = round(average_price, 2)
else:
# 取样本的平均值
new_avg_price = sample['avg_price'].mean()
new_avg_price = round(sample['avg_price'].mean(), 2)
if pd.notna(new_avg_price):
action = UpdateOne(
{'cat': 'office', 'city': city, 'district': district, 'name': office_name, 'date': curr_date},