From af99d85ea0edc9704be579cbef108321c2d9745e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= <250213850@qq.com> Date: Fri, 5 Aug 2022 10:57:16 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E7=95=99=E5=AD=98=E5=88=86?= =?UTF-8?q?=E6=9E=90=E7=99=BE=E5=88=86=E6=AF=94=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/query.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index aaec520..ad0d1cc 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -794,8 +794,8 @@ async def retention_model(request: Request, # 计算概率 for key1, value1 in new_summary_valuess.items(): - new_summary_valuess[key1]['p'] = [round(i / value1['d0'], 2) for i in value1['n']] - new_summary_valuess[key1]['p_outflow'] = [round(i1 / value1['d0'], 2) for i1 in value1['n_outflow']] + new_summary_valuess[key1]['p'] = [round(i*100 / value1['d0'], 2) for i in value1['n']] + new_summary_valuess[key1]['p_outflow'] = [round(i1*100 / value1['d0'], 2) for i1 in value1['n_outflow']] title = ['分组项', '用户数', '次留', *[f'{i + 1}留' for i in retention_n[1:]]]