This commit is contained in:
沈健
2025-04-27 10:39:26 +08:00
parent 82f7359410
commit 82119764c6
+7 -1
View File
@@ -2,11 +2,14 @@ from goojia_utils import DIDATA_DEV_ELASTIC_CLIENT, dateutils, MAIN_MONGO_CLIENT
import pandas as pd
from datetime import datetime
from pymongo import UpdateOne
import sys
import logging
log = logging.getLogger(__name__)
office_sell_stat_conn = MAIN_MONGO_CLIENT.get_collection('fangjia_stat', 'office_sell_stat')
office_rent_stat_conn = MAIN_MONGO_CLIENT.get_collection('fangjia_stat', 'office_rent_stat')
def calc(city, year_month):
query = {'date': year_month, 'cat': 'office'}
if pd.notna(city):
@@ -44,6 +47,9 @@ def calc(city, year_month):
item['sell_price'] = round(city_radio[item['city']] * item['rent_price'] * 30 * 12, 0)
return item
if len(merge2_df) == 0:
print(city + "无数据补充")
return
merge2_df = threads.process_dataframe_multithread(merge2_df, deal, 10)
merge2_df = merge2_df[merge2_df['sell_price'].notna()]