Spaces:
Sleeping
Sleeping
Commit
路
a2d93bb
1
Parent(s):
7eef363
feat: updated website
Browse files
app.py
CHANGED
@@ -375,6 +375,24 @@ elif page == "Customer Analysis":
|
|
375 |
st.subheader("Verificar existencia de datos en historical_data1")
|
376 |
st.write(historical_data.head())
|
377 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
# Verificar los datos hist贸ricos del cliente
|
379 |
st.subheader("Verificar datos hist贸ricos del cliente")
|
380 |
st.write(historical_data[historical_data['cliente_id'] == customer_code_str].head()) # Mostrar algunos datos hist贸ricos para el cliente
|
|
|
375 |
st.subheader("Verificar existencia de datos en historical_data1")
|
376 |
st.write(historical_data.head())
|
377 |
|
378 |
+
# Ensure cliente_id is of type string and strip any leading/trailing whitespace
|
379 |
+
historical_data['cliente_id'] = historical_data['cliente_id'].astype(str).str.strip()
|
380 |
+
customer_code_str = str(customer_code).strip() # Ensure the customer code is also properly formatted
|
381 |
+
|
382 |
+
# Display the unique cliente_id values to make sure they are correctly formatted
|
383 |
+
st.subheader("Verificar valores 煤nicos de cliente_id en historical_data")
|
384 |
+
st.write(historical_data['cliente_id'].unique()) # Show unique cliente_id values
|
385 |
+
|
386 |
+
# Show a sample of the data for the customer
|
387 |
+
st.subheader(f"Verificar datos para cliente_id {customer_code_str}")
|
388 |
+
filtered_historical_data = historical_data[historical_data['cliente_id'] == customer_code_str]
|
389 |
+
|
390 |
+
if not filtered_historical_data.empty:
|
391 |
+
st.success(f"Datos encontrados para cliente {customer_code_str}")
|
392 |
+
st.write(filtered_historical_data.head(20)) # Show more rows to confirm correct filtering
|
393 |
+
else:
|
394 |
+
st.error(f"No se encontraron datos para el cliente {customer_code_str}. Verifique el c贸digo.")
|
395 |
+
|
396 |
# Verificar los datos hist贸ricos del cliente
|
397 |
st.subheader("Verificar datos hist贸ricos del cliente")
|
398 |
st.write(historical_data[historical_data['cliente_id'] == customer_code_str].head()) # Mostrar algunos datos hist贸ricos para el cliente
|