修复bug

This commit is contained in:
Jian Shen
2022-06-20 18:32:52 +08:00
parent b59dbe23e7
commit b020ad3561
+5 -5
View File
@@ -86,11 +86,11 @@ def sell_stat():
city_one_year_count.append({'城市': city, '近一年有样本小区数量': count, '近一年的样本总量': total_num, '总数量': all_num})
print(city + "已处理完, 近一年有样本小区数量" + str(count) + " 近一年的样本总量" + str(total_num))
result_df = pd.DataFrame(city_one_year_count)
result_df = result_df[['城市', '近一年有样本小区数量', '近一年的样本总量']]
df = pd.merge(df, result_df, how='left', on=['城市'])
df['最近一年有样本小区占比'] = round(df['近一年有样本小区数量'] * 100 / df['小区量'], 2)
df.to_excel(aim_file_name, index=False)
result_df = pd.DataFrame(city_one_year_count)
result_df = result_df[['城市', '近一年有样本小区数量', '近一年的样本总量']]
df = pd.merge(df, result_df, how='left', on=['城市'])
df['最近一年有样本小区占比'] = round(df['近一年有样本小区数量'] * 100 / df['小区量'], 2)
df.to_excel(aim_file_name, index=False)
def property_stat():