Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,13 +5,15 @@ import pandas as pd
|
|
5 |
st.set_page_config(layout="wide")
|
6 |
st.title("Examining crime statistics in New York City.")
|
7 |
|
8 |
-
@st.
|
9 |
def load_data():
|
10 |
df = pd.read_csv("https://raw.githubusercontent.com/OOlajide/nyc_crime_dataset/main/nyc_crimes.csv")
|
11 |
return df
|
|
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
def map():
|
15 |
st.pydeck_chart(pdk.Deck(
|
16 |
map_style='mapbox://styles/mapbox/light-v9',
|
17 |
initial_view_state=pdk.ViewState(
|
@@ -32,5 +34,4 @@ def map():
|
|
32 |
extruded=True,
|
33 |
),
|
34 |
],
|
35 |
-
))
|
36 |
-
map()
|
|
|
5 |
st.set_page_config(layout="wide")
|
6 |
st.title("Examining crime statistics in New York City.")
|
7 |
|
8 |
+
@st.experimental_memo()
|
9 |
def load_data():
|
10 |
df = pd.read_csv("https://raw.githubusercontent.com/OOlajide/nyc_crime_dataset/main/nyc_crimes.csv")
|
11 |
return df
|
12 |
+
|
13 |
+
with st.spinner(text="Loading dataset"):
|
14 |
+
df = load_data()
|
15 |
|
16 |
+
with st.spinner(text="Loading map"):
|
|
|
17 |
st.pydeck_chart(pdk.Deck(
|
18 |
map_style='mapbox://styles/mapbox/light-v9',
|
19 |
initial_view_state=pdk.ViewState(
|
|
|
34 |
extruded=True,
|
35 |
),
|
36 |
],
|
37 |
+
))
|
|