ajuste de ids en la gráfica heatmap

para que el el eje Y de la gráfica corresponda con los ids de los
pacientes en vez de una simple enumeración, usamos dichos ids como
índice del dataframe.
parent 6d6609c7
...@@ -344,7 +344,7 @@ def update_por_prueba(visita): ...@@ -344,7 +344,7 @@ 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"]
} }
heatmap = df1.notna().astype(int) heatmap = df1.set_index("id").notna().astype(int)
colorscale = [[0, 'gold'], [1,'mediumturquoise']] colorscale = [[0, 'gold'], [1,'mediumturquoise']]
columnas = [ test for protocolo in protocolos.keys() for test in protocolos[protocolo]] columnas = [ test for protocolo in protocolos.keys() for test in protocolos[protocolo]]
lista = list(set(df1.columns).intersection(set(columnas))) lista = list(set(df1.columns).intersection(set(columnas)))
......
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