From b5144d94a3075658325255dfe6c898d3f02b772f 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 11:49:41 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E4=BF=AE=E7=82=BC=E5=AE=A4?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E5=88=86=E5=B8=83=EF=BC=8C=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E5=88=86=E5=B8=83=EF=BC=8C=E6=B4=BB=E8=B7=83=E5=85=B3=E5=8D=A1?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E6=89=8B=E5=BC=95=E5=AF=BC=E6=BB=9E=E7=95=99?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E7=9A=84=E7=99=BE=E5=88=86=E6=AF=94=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index deedff9..1d5d0b4 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -1072,7 +1072,9 @@ async def scatter_model( number_str=str(number_int)+'%' list_p.append(number_str) resp['list'][dt] = {'总体': {'n': [labels_dict.get(i, 0) for i in labels], 'total': total, - 'p': [round(labels_dict.get(i, 0) * 100 / total, 2) for i in labels]}} + 'p': list_p}} + #resp['list'][dt] = {'总体': {'n': [labels_dict.get(i, 0) for i in labels], 'total': total, + # 'p': [round(labels_dict.get(i, 0) * 100 / total, 2) for i in labels]}} return schemas.Msg(code=0, msg='ok', data=resp) # bins_s = pd.cut(tmp_df['values'], bins=bins,