From 40d7c4470c75783f72c6c6ba04291d344e54feac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= <250213850@qq.com> Date: Sat, 15 Jan 2022 17:49:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B4=BB=E8=B7=83=E7=8E=A9=E5=AE=B6=E5=9F=8E?= =?UTF-8?q?=E5=B8=82=E5=88=86=E5=B8=83=E5=B0=860=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=9C=AA=E7=9F=A5=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/query.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index 1d5d0b4..97f4670 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -261,8 +261,11 @@ async def event_model( for group, df_group in df.groupby(groupby): #在原数据上将索引重新转换为列,新索引的列删除 df_group.reset_index(drop=True, inplace=True) - q['groups'].append(str(group)) - + #判断为0的改成未知城市 + if str(group) == '0' and analysis.event_view['groupBy'][0]['columnDesc']== '城市': + q['groups'].append('未知城市') + else: + q['groups'].append(str(group)) concat_data = [] for i in set(date_range) - set(df_group['date']): if len(groupby) > 1: