Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,16 +103,18 @@ if viz_type == "Complaints Over Time":
|
|
| 103 |
# )
|
| 104 |
|
| 105 |
# Dropdown for Housing Block (only show for relevant visualizations)
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
| 108 |
block_options = ['All Blocks'] + sorted(data['Housing Block'].unique().tolist())
|
| 109 |
selected_block = st.sidebar.selectbox(
|
| 110 |
"Select Housing Block",
|
| 111 |
options=block_options,
|
| 112 |
-
key=
|
| 113 |
)
|
| 114 |
-
|
| 115 |
-
selected_block = 'All Blocks' # Default value if not applicable
|
| 116 |
|
| 117 |
# # Ensuring selected_block is only used if defined
|
| 118 |
# if viz_type in ["Complaints by Housing Block and Type", "Complaints by Housing Block and Type (Incorporating Suggestions Based on Professor's Feedback)"] and 'selected_block' not in locals():
|
|
|
|
| 103 |
# )
|
| 104 |
|
| 105 |
# Dropdown for Housing Block (only show for relevant visualizations)
|
| 106 |
+
selected_block = 'All Blocks' # Default value
|
| 107 |
+
if viz_type in [
|
| 108 |
+
"Complaints by Housing Block and Type",
|
| 109 |
+
"Complaints by Housing Block and Type (Incorporating Suggestions Based on Professor's Feedback)"
|
| 110 |
+
]:
|
| 111 |
block_options = ['All Blocks'] + sorted(data['Housing Block'].unique().tolist())
|
| 112 |
selected_block = st.sidebar.selectbox(
|
| 113 |
"Select Housing Block",
|
| 114 |
options=block_options,
|
| 115 |
+
key="block_select"
|
| 116 |
)
|
| 117 |
+
|
|
|
|
| 118 |
|
| 119 |
# # Ensuring selected_block is only used if defined
|
| 120 |
# if viz_type in ["Complaints by Housing Block and Type", "Complaints by Housing Block and Type (Incorporating Suggestions Based on Professor's Feedback)"] and 'selected_block' not in locals():
|