修改设备LTV当玩短期展示不出来的问题

This commit is contained in:
李伟 2021-12-27 15:01:21 +08:00
parent b461ec87f4
commit effad3ca10

View File

@ -148,12 +148,13 @@ async def ltv_model_sql(
df2 = df[['注册日期', cat, *[f'sumpay_{i}' for i in ltv_n]]] df2 = df[['注册日期', cat, *[f'sumpay_{i}' for i in ltv_n]]]
df2.replace('-', 0, inplace=True) #True改变原数据前面是需要替换的值后面是替换后的值。 在原数据把下划线替换成0 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 = (df2.drop(df2[(df2.sumpay_2 == 0)].index))
#为new_df2排序 #为new_df2排序
new_df2=new_df2.reset_index(drop=True) 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) str_time01=str(str_time)
split_time = str_time01.split('-') split_time = str_time01.split('-')
#str_time = str(res['date_range'][0]) #str_time = str(res['date_range'][0])