James McCool commited on
Commit
8015159
·
1 Parent(s): bdaa1b2

Enhance prop trends UI by adding an expandable filter section for improved user interaction and interface organization

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -136,17 +136,18 @@ with tab2:
136
  if st.button("Reset Data", key='reset3'):
137
  st.cache_data.clear()
138
  prop_display, prop_trends, pick_frame, team_dict = pull_baselines()
139
- split_var5 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var5')
140
- if split_var5 == 'Specific Teams':
141
- team_var5 = st.multiselect('Which teams would you like to include in the tables?', options = prop_trends['Team'].unique(), key='team_var5')
142
- elif split_var5 == 'All':
143
- team_var5 = prop_trends.Team.values.tolist()
144
- book_split5 = st.radio("Would you like to view all books or specific ones?", ('All', 'Specific Books'), key='book_split5')
145
- if book_split5 == 'Specific Books':
146
- book_var5 = st.multiselect('Which books would you like to include in the tables?', options = ['BET_365', 'DRAFTKINGS', 'CONSENSUS', 'FANDUEL', 'MGM', 'UNIBET', 'WILLIAM_HILL'], key='book_var5')
147
- elif book_split5 == 'All':
148
- book_var5 = ['BET_365', 'DRAFTKINGS', 'CONSENSUS', 'FANDUEL', 'MGM', 'UNIBET', 'WILLIAM_HILL']
149
- prop_type_var2 = st.selectbox('Select type of prop are you wanting to view', options = prop_table_options)
 
150
  prop_frame_disp = prop_trends[prop_trends['Team'].isin(team_var5)]
151
  prop_frame_disp = prop_frame_disp[prop_frame_disp['book'].isin(book_var5)]
152
  prop_frame_disp = prop_frame_disp[prop_frame_disp['prop_type'] == prop_type_var2]
 
136
  if st.button("Reset Data", key='reset3'):
137
  st.cache_data.clear()
138
  prop_display, prop_trends, pick_frame, team_dict = pull_baselines()
139
+ with st.expander("Filter Options"):
140
+ split_var5 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var5')
141
+ if split_var5 == 'Specific Teams':
142
+ team_var5 = st.multiselect('Which teams would you like to include in the tables?', options = prop_trends['Team'].unique(), key='team_var5')
143
+ elif split_var5 == 'All':
144
+ team_var5 = prop_trends.Team.values.tolist()
145
+ book_split5 = st.radio("Would you like to view all books or specific ones?", ('All', 'Specific Books'), key='book_split5')
146
+ if book_split5 == 'Specific Books':
147
+ book_var5 = st.multiselect('Which books would you like to include in the tables?', options = ['BET_365', 'DRAFTKINGS', 'CONSENSUS', 'FANDUEL', 'MGM', 'UNIBET', 'WILLIAM_HILL'], key='book_var5')
148
+ elif book_split5 == 'All':
149
+ book_var5 = ['BET_365', 'DRAFTKINGS', 'CONSENSUS', 'FANDUEL', 'MGM', 'UNIBET', 'WILLIAM_HILL']
150
+ prop_type_var2 = st.selectbox('Select type of prop are you wanting to view', options = prop_table_options)
151
  prop_frame_disp = prop_trends[prop_trends['Team'].isin(team_var5)]
152
  prop_frame_disp = prop_frame_disp[prop_frame_disp['book'].isin(book_var5)]
153
  prop_frame_disp = prop_frame_disp[prop_frame_disp['prop_type'] == prop_type_var2]