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: