优化评级报错
This commit is contained in:
@@ -45,6 +45,9 @@ def calc_consumption_potential(city):
|
||||
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 = community_summary_df.dropna(how='any').copy()
|
||||
if len(community_summary_df) == 0:
|
||||
log.warning(f"{city}无法评级,缺少因子")
|
||||
return []
|
||||
|
||||
# 户均总价计算时候改成万
|
||||
community_summary_df['total_price'] = round(community_summary_df['total_price'] / 10000, 0)
|
||||
@@ -155,8 +158,12 @@ def sync_by_city(city_now):
|
||||
|
||||
def sync(city=None):
|
||||
if pd.isna(city):
|
||||
flag = False
|
||||
for city_now in areautils.get_all_cities():
|
||||
sync_by_city(city_now)
|
||||
if city_now == '白沙':
|
||||
flag = True
|
||||
if flag is True:
|
||||
sync_by_city(city_now)
|
||||
else:
|
||||
sync_by_city(city)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user