From bfc2bd3a1a1922d87139b7771d8380be997703da Mon Sep 17 00:00:00 2001 From: wuaho Date: Fri, 11 Jun 2021 16:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E5=AD=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 815ad53..4184bfb 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -141,7 +141,7 @@ async def retention_model( continue key = d1.strftime('%Y-%m-%d') for j, d2 in enumerate(date_range[i:]): - if j >= unit_num: + if j > unit_num: break b = set(summary_df.loc[(d2, event_b)]['values']) if (d2, event_b) in summary_df.index else set() tmp = summary_values.setdefault(key, {}) @@ -160,7 +160,7 @@ async def retention_model( continue key = ','.join((d1.strftime("%Y-%m-%d"), *g)) for j, d2 in enumerate(date_range[i:]): - if j >= unit_num: + if j > unit_num: break b = set(df.loc[(d2, event_b, *g)]['values']) if (d2, event_b, *g) in df.index else set() tmp = values.setdefault(key, {})