From effad3ca107c3bf215ce784ba9c75f5fb7c835c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= <250213850@qq.com> Date: Mon, 27 Dec 2021 15:01:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87LTV?= =?UTF-8?q?=E5=BD=93=E7=8E=A9=E7=9F=AD=E6=9C=9F=E5=B1=95=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/xquery.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/api_v1/endpoints/xquery.py b/api/api_v1/endpoints/xquery.py index 3b8cb46..1d5d36b 100644 --- a/api/api_v1/endpoints/xquery.py +++ b/api/api_v1/endpoints/xquery.py @@ -148,12 +148,13 @@ async def ltv_model_sql( df2 = df[['注册日期', cat, *[f'sumpay_{i}' for i in ltv_n]]] df2.replace('-', 0, inplace=True) #True改变原数据,前面是需要替换的值,后面是替换后的值。 在原数据把下划线替换成0 #修改下面代码 - # 去除sumpay_1的值为0的列 + # 去除sumpay_2的值为0的列 new_df2 = (df2.drop(df2[(df2.sumpay_2 == 0)].index)) #为new_df2排序 new_df2=new_df2.reset_index(drop=True) #求相差天数 - str_time =new_df2['注册日期'][0] + str_time = df2['注册日期'][0] + #str_time =new_df2['注册日期'][0] str_time01=str(str_time) split_time = str_time01.split('-') #str_time = str(res['date_range'][0])