1.优化分布分析中分组项数据是列表时无法显示数据
This commit is contained in:
parent
aaa4cd63ee
commit
7f96405a8c
@ -1227,6 +1227,9 @@ async def scatter_model(
|
|||||||
bins.append(v)
|
bins.append(v)
|
||||||
if 'float' in str(df.dtypes['va']):
|
if 'float' in str(df.dtypes['va']):
|
||||||
df['va'] = df['va'].astype(int)
|
df['va'] = df['va'].astype(int)
|
||||||
|
if 'list' in str(type(df['va'][0])):
|
||||||
|
f = lambda x: x[0]
|
||||||
|
df['va'] = df['va'].map(f)
|
||||||
# 这是分组的
|
# 这是分组的
|
||||||
for key, tmp_df in df.groupby('va'):
|
for key, tmp_df in df.groupby('va'):
|
||||||
|
|
||||||
@ -1271,6 +1274,9 @@ async def scatter_model(
|
|||||||
}
|
}
|
||||||
labels = [str(i) for i in sorted(df['values'].unique())]
|
labels = [str(i) for i in sorted(df['values'].unique())]
|
||||||
resp['label'] = labels
|
resp['label'] = labels
|
||||||
|
if 'list' in str(type(df['va'][0])):
|
||||||
|
f = lambda x: x[0]
|
||||||
|
df['va'] = df['va'].map(f)
|
||||||
for key, tmp_df in df.groupby(['va']):
|
for key, tmp_df in df.groupby(['va']):
|
||||||
total = len(tmp_df)
|
total = len(tmp_df)
|
||||||
if res['time_particle'] == 'total':
|
if res['time_particle'] == 'total':
|
||||||
|
Loading…
Reference in New Issue
Block a user