Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
inventario
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Luis Gordillo Ruiz
inventario
Commits
88d6a6b3
Commit
88d6a6b3
authored
Dec 11, 2024
by
Jose Luis Gordillo Ruiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adicion de grafica de distribucion de %s de macros
parent
246439e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletions
+27
-1
estadisticas.py
+27
-1
No files found.
estadisticas.py
View file @
88d6a6b3
...
...
@@ -191,7 +191,27 @@ def comidas_describe(datos):
)
return
figura
def
comidas_porcentajes
(
datos
):
columnas
=
[
"hc_total"
,
"fiber_total"
,
"protein_total"
,
"lipids_total"
]
datos
[
"total"
]
=
datos
[
columnas
]
.
sum
(
axis
=
1
)
datos
=
datos
[
datos
[
"total"
]
>
0
]
datos
[
columnas
]
=
datos
[
columnas
]
.
div
(
datos
[
"total"
],
axis
=
0
)
print
(
datos
[
columnas
]
.
head
())
figura
=
go
.
Figure
()
lrow
=
1
lcol
=
1
for
columna
in
columnas
:
datosfil
=
datos
[
np
.
abs
(
stats
.
zscore
(
datos
[
columna
],
nan_policy
=
'omit'
))
<
3
]
figura
.
add_trace
(
go
.
Histogram
(
x
=
datosfil
[
columna
],
name
=
columna
),
)
figura
.
update_layout
(
bargap
=
0.05
,
# gap between bars of adjacent location coordinates
bargroupgap
=
0.05
# gap between bars of the same location coordinates
)
return
figura
def
heatmap
(
datos
):
datosfil
=
datos
.
replace
(
0
,
np
.
nan
)
...
...
@@ -414,6 +434,12 @@ app.layout = html.Div(children=[
html
.
Div
(
children
=
[
html
.
H1
(
"Distribución de Macronutrientes de comidas"
,
className
=
"header-title2"
)]),
dcc
.
Graph
(
figure
=
comidas_describe
(
comidas
))
,]),
# descripcion de componentes de macronutrientes de comidas
html
.
Div
(
children
=
[
html
.
Div
(
children
=
[
html
.
H1
(
"Distribución de
%
s de Macronutrientes de comidas"
,
className
=
"header-title2"
)]),
dcc
.
Graph
(
figure
=
comidas_porcentajes
(
comidas
))
,]),
# descripcion de comidas por paciente
html
.
Div
(
children
=
[
html
.
Div
(
children
=
[
html
.
H1
(
"Macronutrientes de comidas por paciente"
,
className
=
"header-title2"
)]),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment