留存时长修复
This commit is contained in:
parent
4e99e96228
commit
0cadeb283a
@ -299,7 +299,7 @@ async def retention_model(request: Request,
|
||||
for i in set(date_range) - set(df.index):
|
||||
df.loc[i] = 0
|
||||
df.sort_index(inplace=True)
|
||||
days = [i for i in range(1, unit_num + 1)]
|
||||
days = [i for i in range(1, unit_num )]
|
||||
summary_values = {}
|
||||
today = datetime.datetime.today().date()
|
||||
|
||||
@ -310,8 +310,8 @@ async def retention_model(request: Request,
|
||||
tmp['n'] = []
|
||||
tmp['p_outflow'] = []
|
||||
tmp['n_outflow'] = []
|
||||
for i in range(1, (today - date).days + 1):
|
||||
if i > unit_num:
|
||||
for i in range(1, (today - date).days):
|
||||
if i >= unit_num:
|
||||
break
|
||||
p = float(getattr(value, f'p{i + 1}'))
|
||||
n = int(getattr(value, f'cnt{i + 1}'))
|
||||
|
Loading…
Reference in New Issue
Block a user