优化评级报错
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:
|
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 []
|
return []
|
||||||
community_summary_df = community_summary_df.dropna(how='any').copy()
|
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)
|
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):
|
def sync(city=None):
|
||||||
if pd.isna(city):
|
if pd.isna(city):
|
||||||
|
flag = False
|
||||||
for city_now in areautils.get_all_cities():
|
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:
|
else:
|
||||||
sync_by_city(city)
|
sync_by_city(city)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user