OOlajide commited on
Commit
eb60c7b
·
1 Parent(s): 3fd7261

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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.cache(allow_output_mutation=True)
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
- @st.cache(allow_output_mutation=True)
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
+ ))