Spaces:
Build error
Build error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -3
src/streamlit_app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import altair as alt
|
| 4 |
from pathlib import Path
|
|
@@ -145,10 +146,10 @@ df_top = df[df['crm_cd_desc'].isin(top_crimes)]
|
|
| 145 |
heatmap1_data = df_top.groupby(['crm_cd_desc', 'year']).size().unstack(fill_value=0)
|
| 146 |
|
| 147 |
# Create the heat map.
|
| 148 |
-
|
| 149 |
sns.heatmap(heatmap1_data, annot=True, fmt="d", cmap="YlOrRd")
|
| 150 |
-
|
| 151 |
-
|
| 152 |
alt.ylabel("Crime Type")
|
| 153 |
alt.tight_layout()
|
| 154 |
alt.show()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import seaborn as sns
|
| 3 |
import pandas as pd
|
| 4 |
import altair as alt
|
| 5 |
from pathlib import Path
|
|
|
|
| 146 |
heatmap1_data = df_top.groupby(['crm_cd_desc', 'year']).size().unstack(fill_value=0)
|
| 147 |
|
| 148 |
# Create the heat map.
|
| 149 |
+
plt.figure(figsize=(10, 6))
|
| 150 |
sns.heatmap(heatmap1_data, annot=True, fmt="d", cmap="YlOrRd")
|
| 151 |
+
plt.title("Top 10 Crime Types by Year")
|
| 152 |
+
plt.xlabel("Year")
|
| 153 |
alt.ylabel("Crime Type")
|
| 154 |
alt.tight_layout()
|
| 155 |
alt.show()
|