GHarshasri commited on
Commit
22b90d2
Β·
verified Β·
1 Parent(s): 0a0f8c4

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -3
src/streamlit_app.py CHANGED
@@ -85,11 +85,15 @@ menu = st.sidebar.radio("Navigation", ["Home", "Add Data", "View by District"])
85
  if menu == "Home":
86
  st.title("🌾 Telangana Famous Products")
87
  st.subheader("Explore Products by District")
88
-
89
-
90
  grouped = {}
91
-
92
  grouped.setdefault(district, {}).setdefault(category, []).append(product)
 
 
 
 
 
93
 
94
  for district, categories in grouped.items():
95
  with st.expander(f"πŸ“ {district}"):
 
85
  if menu == "Home":
86
  st.title("🌾 Telangana Famous Products")
87
  st.subheader("Explore Products by District")
88
+ if data:
 
89
  grouped = {}
90
+ for district, category, product in data:
91
  grouped.setdefault(district, {}).setdefault(category, []).append(product)
92
+
93
+ for district, categories in grouped.items():
94
+ with st.expander(f"πŸ“ {district}"):
95
+ for category, products in categories.items():
96
+ st.write(f"{category}: {', '.join(products)}")
97
 
98
  for district, categories in grouped.items():
99
  with st.expander(f"πŸ“ {district}"):