优化因子不足
This commit is contained in:
@@ -37,13 +37,14 @@ for index, item in factor_df.iterrows():
|
||||
|
||||
|
||||
def calc_consumption_potential(city):
|
||||
if pd.isna(city):
|
||||
return
|
||||
"""
|
||||
计算消费潜力
|
||||
"""
|
||||
sql = "select id, city, region, name, total_price, estate_charge, relative_price_ranking, avg_cost from community_summary where city='" + city + "'"
|
||||
community_summary_df = es206_client.scan_by_sql_to_data_frame(sql)
|
||||
columns = community_summary_df.columns
|
||||
if 'total_price' not in columns or 'estate_charge' not in columns or 'relative_price_ranking' not in columns or 'avg_cost' not in columns:
|
||||
return []
|
||||
|
||||
# 极值设置
|
||||
community_summary_df = filter_min_max(city, community_summary_df).copy()
|
||||
@@ -142,6 +143,9 @@ def calc_consumption_rating(community_summary_df):
|
||||
def sync_by_city(city_now):
|
||||
log.info(f"{city_now}开始评级....")
|
||||
community_summary_df = calc_consumption_potential(city_now)
|
||||
if len(community_summary_df) == 0:
|
||||
log.warning(f"{city_now}无法评级,缺少因子")
|
||||
return
|
||||
calc_consumption_rating(community_summary_df)
|
||||
save_png(city_now)
|
||||
nextcloudutils.up_to_nextcloud(save_png_path + "/" + city_now + ".png", nextcloud_aim_file_path + "/" + city_now + ".png")
|
||||
|
||||
Reference in New Issue
Block a user