分组不存在
This commit is contained in:
parent
7d7a3801c3
commit
5a6bd4ea02
@ -183,7 +183,7 @@ async def event_model(
|
||||
if last_value > 0:
|
||||
q['last_value'] = float(last_value)
|
||||
break
|
||||
if groupby:
|
||||
if groupby and (set(groupby) & set(df) == set(groupby)):
|
||||
q['date_range'] = [f'{i}' for i in df.set_index(groupby).index]
|
||||
else:
|
||||
q['date_range'] = ['合计']
|
||||
@ -191,7 +191,7 @@ async def event_model(
|
||||
res.append(q)
|
||||
continue
|
||||
|
||||
if groupby:
|
||||
if groupby and (set(groupby) & set(df)) == set(groupby):
|
||||
# 有分组
|
||||
for group, df_group in df.groupby(groupby):
|
||||
df_group.reset_index(drop=True, inplace=True)
|
||||
|
Loading…
Reference in New Issue
Block a user