Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -225,14 +225,16 @@ elif menu == "Current":
|
|
225 |
"Colacaos": {
|
226 |
"Colacao": 1.50,
|
227 |
},
|
228 |
-
"
|
229 |
-
"
|
230 |
-
"
|
231 |
-
"Palmera de chocolate": 1.50,
|
232 |
-
"Palmera de chocolate blanco": 1.50,
|
233 |
-
"Yogurt": 1.00,
|
234 |
-
"Pincho de tortilla": 1.50
|
235 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
"Nada": 0.00,
|
237 |
}
|
238 |
|
@@ -279,13 +281,47 @@ elif menu == "Current":
|
|
279 |
drinks.append(row['Drinks'])
|
280 |
foods.append(row['Food'])
|
281 |
|
282 |
-
#
|
283 |
drinks = ["Café" if x in item_prices["Cafés"].keys() else x for x in drinks]
|
|
|
|
|
284 |
|
285 |
# Display selections
|
286 |
st.write(f"Drinks: {drinks}")
|
287 |
st.write(f"Foods: {foods}")
|
288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
|
290 |
|
291 |
# drinks = row['Drinks'].split(", ") if isinstance(row['Drinks'], str) else []
|
|
|
225 |
"Colacaos": {
|
226 |
"Colacao": 1.50,
|
227 |
},
|
228 |
+
"Palmeras": {
|
229 |
+
"Palmera chocolate": 1.50,
|
230 |
+
"Palmera chocolate blanco": 1.50,
|
|
|
|
|
|
|
|
|
231 |
},
|
232 |
+
"Barrita aceite": 0.65,
|
233 |
+
"Barrita tomate": 1.30,
|
234 |
+
"Napolitana": 0.65,
|
235 |
+
"Croissant": 0.65,
|
236 |
+
"Yogurt": 1.00,
|
237 |
+
"Tortilla": 1.50,
|
238 |
"Nada": 0.00,
|
239 |
}
|
240 |
|
|
|
281 |
drinks.append(row['Drinks'])
|
282 |
foods.append(row['Food'])
|
283 |
|
284 |
+
# Simplify items
|
285 |
drinks = ["Café" if x in item_prices["Cafés"].keys() else x for x in drinks]
|
286 |
+
drinks = ["Infusión" if x in item_prices["Infusiones"].keys() else x for x in drinks]
|
287 |
+
foods = ["Palmera" if x in item_prices["Palmeras"].keys() else x for x in foods]
|
288 |
|
289 |
# Display selections
|
290 |
st.write(f"Drinks: {drinks}")
|
291 |
st.write(f"Foods: {foods}")
|
292 |
|
293 |
+
# Count items
|
294 |
+
item_count = {
|
295 |
+
"Café": len([x for x in drinks if x == "Café"]),
|
296 |
+
"Infusión": len([x for x in drinks if x == "Infusión"]),
|
297 |
+
"Colacao": len([x for x in drinks if x == "Colacao"]),
|
298 |
+
"Barrita aceite": len([x for x in drinks if x == "Barrita aceite"]),
|
299 |
+
"Barrita tomate": len([x for x in drinks if x == "Barrita tomate"]),
|
300 |
+
"Napolitana": len([x for x in drinks if x == "Napolitana"]),
|
301 |
+
"Palmera": len([x for x in drinks if x == "Palmeras"]),
|
302 |
+
"Tortilla": len([x for x in drinks if x == "Tortilla"]),
|
303 |
+
"Croissant": len([x for x in drinks if x == "Croissant"]),
|
304 |
+
"Yogurt": len([x for x in drinks if x == "Yogurt"]),
|
305 |
+
}
|
306 |
+
|
307 |
+
# Make associations
|
308 |
+
item_association = {}
|
309 |
+
food_count = item_count["Barrita aceite"] + item_count["Barrita tomate"] + item_count["Napolitana"] + item_count["Croissant"]
|
310 |
+
if item_count["Café"] >= food_count:
|
311 |
+
item_association["Desayuno + Café (tomate)"] = item_count["Barrita tomate"]
|
312 |
+
item_association["Desayuno + Café (aceite)"] = item_count["Barrita aceite"]
|
313 |
+
item_association["Desayuno + Café (napolitana)"] = item_count["Napolitana"]
|
314 |
+
item_association["Desayuno + Café (croissant)"] = item_count["Croissant"]
|
315 |
+
item_association["Café"] = item_count["Café"] - food_count
|
316 |
+
else:
|
317 |
+
raise NotImplementedError
|
318 |
+
item_association["Colacaos"] = item_count["Colacao"]
|
319 |
+
item_association["Yogurts"] = item_count["Yogurt"]
|
320 |
+
item_association["Tortillas"] = item_count["Tortilla"]
|
321 |
+
item_association["Palmeras"] = item_count["Palmera"]
|
322 |
+
item_association["Infusiones"] = item_count["Infusión"]
|
323 |
+
|
324 |
+
st.write(item_association)
|
325 |
|
326 |
|
327 |
# drinks = row['Drinks'].split(", ") if isinstance(row['Drinks'], str) else []
|