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])