James McCool commited on
Commit
3c2ff58
·
1 Parent(s): 6c39dd6

added book filter to prop trends

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -201,9 +201,15 @@ with tab3:
201
  team_var5 = st.multiselect('Which teams would you like to include in the tables?', options = player_stats['Team'].unique(), key='team_var5')
202
  elif split_var5 == 'All':
203
  team_var5 = player_stats.Team.values.tolist()
 
 
 
 
 
204
  prop_type_var2 = st.selectbox('Select type of prop are you wanting to view', options = prop_table_options)
205
  prop_frame_disp = prop_frame[prop_frame['Team'].isin(team_var5)]
206
- prop_frame_disp = prop_frame_disp[prop_frame_disp['prop_type'] == prop_type_var2]
 
207
  prop_frame_disp = prop_frame_disp.set_index('Name')
208
  prop_frame_disp = prop_frame_disp.sort_values(by='Trending Over', ascending=False)
209
  st.dataframe(prop_frame_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(prop_format, precision=2), use_container_width = True)
 
201
  team_var5 = st.multiselect('Which teams would you like to include in the tables?', options = player_stats['Team'].unique(), key='team_var5')
202
  elif split_var5 == 'All':
203
  team_var5 = player_stats.Team.values.tolist()
204
+ book_split5 = st.radio("Would you like to view all books or specific ones?", ('All', 'Specific Books'), key='book_split5')
205
+ if book_split5 == 'Specific Books':
206
+ book_var5 = st.multiselect('Which books would you like to include in the tables?', options = prop_frame['OddsType'].unique(), key='book_var5')
207
+ elif book_split5 == 'All':
208
+ book_var5 = prop_frame.OddsType.values.tolist()
209
  prop_type_var2 = st.selectbox('Select type of prop are you wanting to view', options = prop_table_options)
210
  prop_frame_disp = prop_frame[prop_frame['Team'].isin(team_var5)]
211
+ prop_frame_disp = prop_frame_disp[prop_frame_disp['book'].isin(book_var5)]
212
+ prop_frame_disp = prop_frame_disp[prop_frame_disp['PropType'] == prop_type_var2]
213
  prop_frame_disp = prop_frame_disp.set_index('Name')
214
  prop_frame_disp = prop_frame_disp.sort_values(by='Trending Over', ascending=False)
215
  st.dataframe(prop_frame_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(prop_format, precision=2), use_container_width = True)