From fdedc4cbf218fb623ad78a4ad58b192f8419f358 Mon Sep 17 00:00:00 2001 From: sunqiang Date: Sun, 26 Nov 2023 12:00:19 +0800 Subject: [PATCH] =?UTF-8?q?pd.read=E6=8D=A2=E6=88=90pgsql.scan=5Fby=5Fsql?= =?UTF-8?q?=5Fto=5Fdata=5Fframe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/jh/price/price_deviation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dags/jh/price/price_deviation.py b/dags/jh/price/price_deviation.py index b5b55b3..9c76b07 100644 --- a/dags/jh/price/price_deviation.py +++ b/dags/jh/price/price_deviation.py @@ -29,7 +29,7 @@ deal_price_df = deal_df.merge(price_df, on="gujia_comm_id", how="left") deal_price_df["ppe"] = round((deal_price_df["gujia_comm_basic_prc"] - deal_price_df['gujia_bds_trdtckt_prc']) / deal_price_df['gujia_bds_trdtckt_prc'], 4) deal_price_df = deal_price_df[abs(deal_price_df['ppe']) > 0.15] -third_df = pd.read_sql(f"select gujia_bds_id as gujia_comm_id,gujia_dtsr_dsc,gujia_bds_comm_avprc from base.t0831_bigdata_third_party_price_gj_h where gujiabds_avprc_dt_val={month_last} ") +third_df = pgsql.scan_by_sql_to_data_frame(f"select gujia_bds_id as gujia_comm_id,gujia_dtsr_dsc,gujia_bds_comm_avprc from base.t0831_bigdata_third_party_price_gj_h where gujiabds_avprc_dt_val={month_last} ") third_df = third_df[third_df.gujia_dtsr_dsc.isin(['贝壳','链家'])] # third_df = third_df[['gujia_comm_id','gujia_dtsr_dsc','gujia_bds_comm_avprc']] pivot_df = third_df.pivot(index='gujia_comm_id', columns='gujia_dtsr_dsc', values='gujia_bds_comm_avprc').reset_index()