From 2cec740503a3614442cef5d535c2789659e34f39 Mon Sep 17 00:00:00 2001 From: wuaho Date: Tue, 30 Nov 2021 15:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E5=AD=98=E5=9D=87=E5=80=BC=E6=80=BB?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index 1cfc1ba..40ea2f7 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -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)