muestra de existencia de pruebas como un heatmap

parent a24e250c
...@@ -344,21 +344,12 @@ def update_por_prueba(visita): ...@@ -344,21 +344,12 @@ def update_por_prueba(visita):
"biochemical" :["hba1c", "glucose", "ct", "tag", "ldl", "hdl", "pcr","alt", "ast","homa", "insuline" ], "biochemical" :["hba1c", "glucose", "ct", "tag", "ldl", "hdl", "pcr","alt", "ast","homa", "insuline" ],
"antropometric" : ["imc", "weight", "waist_circumference"] "antropometric" : ["imc", "weight", "waist_circumference"]
} }
figura = make_subplots(rows=2, cols=3, vertical_spacing=0.25) heatmap = df1.notna()
for protocolo in protocolos.keys(): colorscale = [[0, 'gold'], [1,'mediumturquoise']]
columnas = list(set(df1.columns).intersection(set(protocolos[protocolo]))) columnas = [ test for protocolo in protocolos.keys() for test in protocolos[protocolo]]
cuentas = 100 * df1[columnas].replace("",np.nan).count() / len(df1) lista = list(set(df1.columns).intersection(set(columnas)))
figura.add_trace( figura = px.imshow(heatmap[lista], color_continuous_scale=colorscale)
go.Bar(x=cuentas.index, y=cuentas, textposition='auto', text=cuentas), figura.update_layout(dict(coloraxis_showscale=False))
row = lrow,
col = lcol,
)
lcol = lcol + 1
if lcol > 3:
lcol = 1
lrow = lrow + 1
figura.update_layout(showlegend=False)
figura.update_traces(texttemplate='%{text:.2s}', textposition='auto')
return figura return figura
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment