留存均值总数

This commit is contained in:
wuaho 2021-11-30 15:20:57 +08:00
parent 6c605483fd
commit 2cec740503

View File

@ -356,7 +356,7 @@ async def retention_model(request: Request,
tmp['n_outflow'] = []
tmp['d0'] = 0
for rt, rd in retention_avg_dict.items():
tmp['d0'] = tmp['d0'] + rd['cnt0']
tmp['d0'] = int(df['cnt0'].sum())
n = round(rd['cntn'] * 100 / rd['cnt0'],2)
n = 0 if np.isnan(n) else n
tmp['p'].append(n)