From b020ad35611349a1f855acdb117b434623bb3e4f Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 20 Jun 2022 18:32:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/stat/evaluate/district_sell_property.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dags/stat/evaluate/district_sell_property.py b/dags/stat/evaluate/district_sell_property.py index f7830af..cde2cce 100644 --- a/dags/stat/evaluate/district_sell_property.py +++ b/dags/stat/evaluate/district_sell_property.py @@ -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():