From 8f6744966d92304a62906d304cdfa3d80c922a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Mon, 26 Aug 2024 11:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/percentile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dags/business/business/community/percentile.py b/dags/business/business/community/percentile.py index d0efdb4..6e120c9 100644 --- a/dags/business/business/community/percentile.py +++ b/dags/business/business/community/percentile.py @@ -17,14 +17,14 @@ def calc_percentile(city=None): """ 计算消费等级 """ - sql = "select id, city, region, name, avg_price, total_price, avg_cost, rent_price, relative_price_ranking, finish_building_date, estate_charge_fix, household_count from community_summary" + sql = "select id, city, region, name, avg_price, total_price, avg_cost, rent_price, relative_price_ranking, finish_building_date, estate_charge, estate_charge_fix, household_count from community_summary" if pd.notna(city): sql += " where city='" + city + "'" community_summary_df = es206_client.scan_by_sql_to_data_frame(sql) - + community_summary_df['estate_charge_fix'] = community_summary_df['estate_charge'].combine_first(community_summary_df['estate_charge_fix']) + community_summary_df['relative_price_ranking'] = community_summary_df['relative_price_ranking'] * 100 consumption_aim_df = community_summary_df[['id', 'city', 'avg_price', 'total_price', 'avg_cost', 'rent_price', 'relative_price_ranking', 'finish_building_date', 'estate_charge_fix', 'household_count']] - number = [] for i in range(1, 101): number.append(i / 100)