Spaces:
Build error
Build error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +9 -0
src/streamlit_app.py
CHANGED
|
@@ -254,6 +254,15 @@ crime_dropdown = ipywidgets.Dropdown(
|
|
| 254 |
options= sorted(top_10_crimes),
|
| 255 |
description="Crime Type:")
|
| 256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
# Create the map.
|
| 258 |
def crime_map(year, crime):
|
| 259 |
df_filtered = df[(df['year'] == year) & (df['crm_cd_desc'] == crime)].sample(n=300, random_state=1)
|
|
|
|
| 254 |
options= sorted(top_10_crimes),
|
| 255 |
description="Crime Type:")
|
| 256 |
|
| 257 |
+
# Load geojson file.
|
| 258 |
+
# gdf_counties = gpd.read_file("County_Boundary.geojson")
|
| 259 |
+
|
| 260 |
+
# Creat dropdown menu.
|
| 261 |
+
year_dropdown = ipywidgets.Dropdown(
|
| 262 |
+
options= sorted(df['year'].unique()),
|
| 263 |
+
description='Year:'
|
| 264 |
+
)
|
| 265 |
+
|
| 266 |
# Create the map.
|
| 267 |
def crime_map(year, crime):
|
| 268 |
df_filtered = df[(df['year'] == year) & (df['crm_cd_desc'] == crime)].sample(n=300, random_state=1)
|