GMARTINEZMILLA commited on
Commit
ca9aa30
1 Parent(s): 56f6289

feat: updated website

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -243,13 +243,13 @@ elif page == "Customer Analysis":
243
  st.title("Customer Analysis")
244
  st.markdown("Use the tools below to explore your customer data.")
245
 
246
- partial_code = st.text_input("Enter part of Customer Code (or leave empty to see all)")
247
- if partial_code:
248
- filtered_customers = df[df['CLIENTE'].str.contains(partial_code)]
249
- else:
250
- filtered_customers = df
251
- customer_list = filtered_customers['CLIENTE'].unique()
252
- customer_code = st.selectbox("Select Customer Code", customer_list)
253
 
254
  if st.button("Calcular"):
255
  if customer_code:
 
243
  st.title("Customer Analysis")
244
  st.markdown("Use the tools below to explore your customer data.")
245
 
246
+ # Combine text input and dropdown into a single searchable selectbox
247
+ customer_code = st.selectbox(
248
+ "Search and Select Customer Code",
249
+ df['CLIENTE'].unique(), # All customer codes
250
+ format_func=lambda x: str(x), # Ensures the values are displayed as strings
251
+ help="Start typing to search for a specific customer code"
252
+ )
253
 
254
  if st.button("Calcular"):
255
  if customer_code: