户均总价补全调整
This commit is contained in:
@@ -49,13 +49,6 @@ def save(community_factor_df):
|
||||
actions.clear()
|
||||
|
||||
|
||||
def complete_by_area(community_df):
|
||||
factor_df = pd.read_csv(path + '/小区户均总价面积因子已去极值.csv', sep='@', encoding='UTF-8')
|
||||
community_factor_df = pd.merge(community_df, factor_df, how='left', on=['_id', 'city', 'region', 'name'])
|
||||
community_factor_df['total_price'] = community_factor_df['avg_price'] * community_factor_df['factor']
|
||||
return community_factor_df
|
||||
|
||||
|
||||
def complete_by_build_year_area(community_factor_df):
|
||||
build_year_area_df = pd.read_excel(path + '/全国各区各建筑年代户均面积已去极值.xlsx')
|
||||
build_year_area_dict = dict()
|
||||
@@ -114,10 +107,10 @@ def sync(city=None):
|
||||
community_df = es206_client.scan_by_sql_to_data_frame(sql)
|
||||
|
||||
if len(community_df) > 0:
|
||||
community_factor_df = complete_by_area(community_df)
|
||||
complete_by_build_year_area(community_factor_df)
|
||||
complete_by_region_area(community_factor_df)
|
||||
save(community_factor_df)
|
||||
community_df['total_price'] = None
|
||||
complete_by_build_year_area(community_df)
|
||||
complete_by_region_area(community_df)
|
||||
save(community_df)
|
||||
|
||||
log.info(f"完成补全户均总价信息至206 {index_name}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user