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
97e51093
Commit
97e51093
authored
Mar 26, 2025
by
Itzel Camacho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agregué la fecha de las fotos de las comidas via whatsapp a la glucosa
parent
2d0f77e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
estadisticas_comidas.py
+9
-2
No files found.
estadisticas_comidas.py
View file @
97e51093
...
...
@@ -276,6 +276,8 @@ df_total['FH_salto'] = pd.to_datetime(df_total['FH_salto'])
df_total
[
'FH_reportada'
]
=
pd
.
to_datetime
(
df_total
[
'FH_reportada'
])
df_total
[
'FH_foto'
]
=
pd
.
to_datetime
(
df_total
[
'FH_foto'
])
df_fotos
=
pd
.
read_csv
(
"delasfotos.csv"
)
df_fotos
[
'fecha_hora'
]
=
pd
.
to_datetime
(
df_fotos
[
'fecha_hora'
])
external_stylesheets
=
[
{
...
...
@@ -394,6 +396,7 @@ def update_graph(selected_pat, rango_str):
glucosa
=
readGlucosa
(
selected_pat
)
visita
=
readVisitas
(
1
)
fecha_visita1
=
pd
.
to_datetime
(
visita
.
loc
[
visita
[
'id'
]
==
selected_pat
,
'visit_date'
]
.
iloc
[
0
])
patient_fotos
=
df_fotos
.
loc
[(
df_fotos
[
'patient'
]
==
selected_pat
)
&
(
df_fotos
[
'fecha_hora'
]
<
fecha_visita1
+
pd
.
Timedelta
(
days
=
15
))]
if
glucosa
.
empty
:
return
go
.
Figure
()
filtered_glucosa
=
glucosa
[(
glucosa
[
'date_time'
]
>=
fecha_visita1
)
&
...
...
@@ -415,11 +418,14 @@ def update_graph(selected_pat, rango_str):
y_foto
=
np
.
interp
(
pd
.
to_numeric
(
patient_foods
[
'FH_foto'
]),
pd
.
to_numeric
(
glucosa
[
'date_time'
]),
# interpolar fecha de la foto con glucosa
glucosa
[
'value'
])
y_fotos_wpp
=
np
.
interp
(
pd
.
to_numeric
(
patient_fotos
[
'fecha_hora'
]),
pd
.
to_numeric
(
glucosa
[
'date_time'
]),
# interpolar fecha de la foto con glucosa
glucosa
[
'value'
])
# valores del dropdown y separarlos para convertirlos en una lista
if
rango_str
==
'0'
:
fig
.
add_trace
(
go
.
Scatter
(
x
=
patient_foods
[
'FH_reportada'
],
y
=
y_foods
,
mode
=
'markers'
,
name
=
'Comida completa'
,
marker
=
dict
(
color
=
'red'
,
size
=
10
)))
fig
.
add_trace
(
go
.
Scatter
(
x
=
patient_foods
[
'FH_foto'
],
y
=
y_foto
,
mode
=
'markers'
,
name
=
'Foto comida'
,
marker
=
dict
(
color
=
'yellow'
,
size
=
8
)))
fig
.
add_trace
(
go
.
Scatter
(
x
=
patient_foods
[
'FH_foto'
],
y
=
y_foto
,
mode
=
'markers'
,
name
=
'Foto app'
,
marker
=
dict
(
color
=
'yellow'
,
size
=
8
)))
fig
.
add_trace
(
go
.
Scatter
(
x
=
patient_fotos
[
'fecha_hora'
],
y
=
y_fotos_wpp
,
mode
=
'markers'
,
name
=
'Foto whatsapp'
,
marker
=
dict
(
color
=
'purple'
,
size
=
8
)))
return
fig
elif
rango_str
==
'[>120]'
:
...
...
@@ -438,7 +444,8 @@ def update_graph(selected_pat, rango_str):
mode
=
'markers'
,
name
=
'Comida completa'
,
marker
=
dict
(
color
=
'red'
,
size
=
10
)))
fig
.
add_trace
(
go
.
Scatter
(
x
=
fotos_wfoods
.
values
,
y
=
y_foto_wfood
,
mode
=
'markers'
,
name
=
'Foto comida'
,
marker
=
dict
(
color
=
'yellow'
,
size
=
8
)))
fig
.
add_trace
(
go
.
Scatter
(
x
=
fotos_wfoods
.
values
,
y
=
y_foto_wfood
,
mode
=
'markers'
,
name
=
'Foto app'
,
marker
=
dict
(
color
=
'yellow'
,
size
=
8
)))
fig
.
add_trace
(
go
.
Scatter
(
x
=
patient_fotos
[
'fecha_hora'
],
y
=
y_fotos_wpp
,
mode
=
'markers'
,
name
=
'Foto whatsapp'
,
marker
=
dict
(
color
=
'purple'
,
size
=
8
)))
fig
.
update_layout
(
transition_duration
=
500
)
return
fig
...
...
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