Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- 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}"):
|