新增近半年挂牌量统计

This commit is contained in:
shenjian@fangjia.com
2022-12-05 16:22:37 +08:00
parent b262f40826
commit 9a5439f3a7
+9 -2
View File
@@ -20,6 +20,9 @@ def build_doc(item):
doc_dict = dict()
if 'three_months_sell_num' in item and pd.notna(item['three_months_sell_num']):
doc_dict['three_months_sell_num'] = int(item['three_months_sell_num'])
if 'half_on_year_sell_num' in item and pd.notna(item['half_on_year_sell_num']):
doc_dict['half_on_year_sell_num'] = int(item['half_on_year_sell_num'])
return doc_dict
@@ -46,8 +49,12 @@ def sync(city=None):
names_str = "'" + names_str + "'"
# 近三个月挂牌量
sample_num = commutils.get_sample(curr_city, curr_region, names_str, cat='sell', daysBefore=93)
seaweed_df.loc[index, 'three_months_sell_num'] = sample_num
# sample_num = commutils.get_sample(curr_city, curr_region, names_str, cat='sell', daysBefore=93)
# seaweed_df.loc[index, 'three_months_sell_num'] = sample_num
# 近半年挂牌量
sample_num = commutils.get_sample(curr_city, curr_region, names_str, cat='sell', daysBefore=186)
seaweed_df.loc[index, 'half_on_year_sell_num'] = sample_num
for index, item in seaweed_df.iterrows():
pool.submit(deal, index, item)