From 4e3926e4b13eca6bba6a7ac89fe4aad4390987b3 Mon Sep 17 00:00:00 2001 From: wuaho Date: Tue, 24 Aug 2021 11:40:35 +0800 Subject: [PATCH] 1 --- 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 87ba0a0..31cc298 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -174,7 +174,7 @@ async def retention_model( tmp.setdefault('d0', len(a)) tmp.setdefault('p', []).append(division(len(a & b) * 100, len(a))) tmp.setdefault('n', []).append(len(a & b)) - tmp.setdefault('p_outflow', []).append(100 - division(len(a & b) * 100, len(a))) + tmp.setdefault('p_outflow', []).append(round(100 - division(len(a & b) * 100, len(a)), 2)) tmp.setdefault('n_outflow', []).append(len(a) - len(a & b)) groups = set([tuple(i) for i in df[res['groupby']].values]) df.set_index(res['groupby'], inplace=True)