优化
This commit is contained in:
@@ -74,7 +74,7 @@ def calc(city, year_month):
|
|||||||
avg_price = stat['avg_price']
|
avg_price = stat['avg_price']
|
||||||
if pd.notna(avg_price):
|
if pd.notna(avg_price):
|
||||||
action = UpdateOne({'city': city, 'name': name, 'cat': 'business', 'date': year_month},
|
action = UpdateOne({'city': city, 'name': name, 'cat': 'business', 'date': year_month},
|
||||||
{'$set': {'city': city, 'cat': 'business', 'date': year_month, 'avg_price': avg_price,
|
{'$set': {'city': city, 'name': name, 'cat': 'business', 'date': year_month, 'avg_price': avg_price,
|
||||||
'updated_date': datetime.now()}},
|
'updated_date': datetime.now()}},
|
||||||
upsert=True)
|
upsert=True)
|
||||||
actions.append(action)
|
actions.append(action)
|
||||||
|
|||||||
Reference in New Issue
Block a user