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
ec2ff7ee
Commit
ec2ff7ee
authored
Mar 19, 2025
by
Itzel Camacho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Definir el rango del eje y, entre [50-200]
parent
686c6bea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
estadisticas_comidas.py
+5
-4
No files found.
estadisticas_comidas.py
View file @
ec2ff7ee
import
pandas
as
pd
from
dash
import
Dash
,
Input
,
Output
,
dcc
,
html
,
callback
from
dash
import
Dash
,
Input
,
Output
,
State
,
dcc
,
html
,
callback
import
plotly.graph_objects
as
go
import
plotly.express
as
px
import
plotly.figure_factory
as
ff
...
...
@@ -378,10 +378,10 @@ app.layout = html.Div(children=[
@callback
(
Output
(
'glucosa-graph'
,
'figure'
),
[
Input
(
'
rango
'
,
'value'
),
Input
(
'
slider-patient'
,
'value'
)]
[
Input
(
'
slider-patient
'
,
'value'
),
Input
(
'
rango'
,
'value'
)],
)
def
update_graph
(
rango_str
,
selected_pat
):
def
update_graph
(
selected_pat
,
rango_str
):
if
selected_pat
not
in
df_total
[
'patient'
]:
return
go
.
Figure
()
if
not
selected_pat
or
not
rango_str
:
...
...
@@ -402,6 +402,7 @@ def update_graph(rango_str, selected_pat):
y
=
filtered_glucosa
[
'value'
],
mode
=
'lines'
,
name
=
'Glucosa paciente visita 1'
))
fig
.
update_layout
(
yaxis
=
dict
(
range
=
[
50
,
200
]))
y_foods
=
np
.
interp
(
patient_foods
[
'FH_reportada'
],
glucosa
[
'date_time'
],
glucosa
[
'value'
])
# interpolar fecha de las comidas con glucosa
distancias
=
abs
((
patient_foods
[
'FH_salto'
]
-
patient_foods
[
'FH_reportada'
])
.
dt
.
total_seconds
())
/
60
distancias_df
=
pd
.
concat
([
distancias
,
patient_foods
[
'FH_reportada'
],
patient_foods
[
'FH_foto'
]],
axis
=
1
,
ignore_index
=
True
)
...
...
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