Spaces:
Build error
Build error
Commit 路
d86334e
1
Parent(s): 673b400
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,12 +56,13 @@ def cargar_dataframe_1(eleccion):
|
|
| 56 |
# Filtrar las filas que corresponden a los nombres dados
|
| 57 |
nuevo_df = nuevo_df[nuevo_df[nombre_primera_columna].isin(etiquetas_filtradas)]
|
| 58 |
|
|
|
|
| 59 |
suma = 0.0
|
| 60 |
# Utilizar un bucle for para sumar todas las filas de la columna
|
| 61 |
for valor in nuevo_df['Kcal/Raci贸n(g)']:
|
| 62 |
suma += float(valor)
|
| 63 |
|
| 64 |
-
return nuevo_df, f"{suma} kcal"
|
| 65 |
|
| 66 |
def cargar_dataframe_2():
|
| 67 |
|
|
@@ -236,9 +237,12 @@ Tabla1 = gr.Interface(
|
|
| 236 |
),
|
| 237 |
live=True,
|
| 238 |
outputs=[gr.Dataframe(
|
| 239 |
-
headers=["
|
| 240 |
label="Resumen alimenticio",
|
| 241 |
-
), gr.Textbox(label="Total kcal")
|
|
|
|
|
|
|
|
|
|
| 242 |
#gr.Textbox(label="Total kcal")],
|
| 243 |
description="Desglose de los alimentos y sus calor铆as, as铆 como recuento total.",
|
| 244 |
)
|
|
@@ -250,7 +254,7 @@ Tabla2 = gr.Interface(
|
|
| 250 |
),
|
| 251 |
live=True,
|
| 252 |
outputs=[gr.Dataframe(
|
| 253 |
-
headers=["
|
| 254 |
label="Resumen alimenticio",
|
| 255 |
), gr.Textbox(label="Total kcal")],
|
| 256 |
#outputs="dataframe",
|
|
|
|
| 56 |
# Filtrar las filas que corresponden a los nombres dados
|
| 57 |
nuevo_df = nuevo_df[nuevo_df[nombre_primera_columna].isin(etiquetas_filtradas)]
|
| 58 |
|
| 59 |
+
version2 = cargar_dataframe_2()
|
| 60 |
suma = 0.0
|
| 61 |
# Utilizar un bucle for para sumar todas las filas de la columna
|
| 62 |
for valor in nuevo_df['Kcal/Raci贸n(g)']:
|
| 63 |
suma += float(valor)
|
| 64 |
|
| 65 |
+
return nuevo_df, f"{suma} kcal", version2
|
| 66 |
|
| 67 |
def cargar_dataframe_2():
|
| 68 |
|
|
|
|
| 237 |
),
|
| 238 |
live=True,
|
| 239 |
outputs=[gr.Dataframe(
|
| 240 |
+
headers=["Alimento", "Raci贸n(g)", "Kcal/Raci贸n(g)"],
|
| 241 |
label="Resumen alimenticio",
|
| 242 |
+
), gr.Textbox(label="Total kcal"),
|
| 243 |
+
gr.Dataframe(
|
| 244 |
+
headers=["Alimento", "Grasa", "Carbh, Prot"],
|
| 245 |
+
label="M谩s detalles"],
|
| 246 |
#gr.Textbox(label="Total kcal")],
|
| 247 |
description="Desglose de los alimentos y sus calor铆as, as铆 como recuento total.",
|
| 248 |
)
|
|
|
|
| 254 |
),
|
| 255 |
live=True,
|
| 256 |
outputs=[gr.Dataframe(
|
| 257 |
+
headers=["Alimento", "Raci贸n(g)", "Kcal/100g", "Total"],
|
| 258 |
label="Resumen alimenticio",
|
| 259 |
), gr.Textbox(label="Total kcal")],
|
| 260 |
#outputs="dataframe",
|