jholst commited on
Commit
bbb4f5f
1 Parent(s): 48fdb1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -19,3 +19,18 @@ def load_data(nrows):
19
  data_load_state = st.text('Loading data...')
20
  data = load_data(10000)
21
  data_load_state.text("Done! (using st.cache_data)")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  data_load_state = st.text('Loading data...')
20
  data = load_data(10000)
21
  data_load_state.text("Done! (using st.cache_data)")
22
+
23
+ if st.checkbox('Show raw data'):
24
+ st.subheader('Raw data')
25
+ st.write(data)
26
+
27
+ st.subheader('Number of pickups by hour')
28
+ hist_values = np.histogram(data[DATE_COLUMN].dt.hour, bins=24, range=(0,24))[0]
29
+ st.bar_chart(hist_values)
30
+
31
+ # Some number in the range 0-23
32
+ hour_to_filter = st.slider('hour', 0, 23, 17)
33
+ filtered_data = data[data[DATE_COLUMN].dt.hour == hour_to_filter]
34
+
35
+ st.subheader('Map of all pickups at %s:00' % hour_to_filter)
36
+ st.map(filtered_data)