ralate2 commited on
Commit
9d5c9ab
·
verified ·
1 Parent(s): ea40752

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
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
- if viz_type in ["Complaints by Housing Block and Type",
107
- "Complaints by Housing Block and Type (Incorporating Suggestions Based on Professor's Feedback)"]:
 
 
 
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=f"block_select_{viz_type.replace(' ', '_')}" # Unique key for each visualization
113
  )
114
- else:
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():