修复商铺均价BUG

This commit is contained in:
沈健
2025-04-25 16:36:03 +08:00
parent 72106ba0ae
commit 16aea01faf
+1 -1
View File
@@ -20,7 +20,7 @@ def calc(city, year_month):
"select * from latest_seawater where cat='shop_sell' and city='" + city + "' and p_date>=" + str(
year_month) + "01 and p_date<=" + str(year_month) + "31 ")
if len(shop) > 0:
shop['day_avg_price'] = shop['avg_price'] / 30
shop['day_avg_price'] = shop['avg_price']
# 计算总价的Z-score
shop['Z_Score'] = (shop['day_avg_price'] - shop['day_avg_price'].mean()) / shop['day_avg_price'].std()
# 剔除Z-score超过0.1的异常值