James McCool commited on
Commit
17befda
·
1 Parent(s): b13ca67

Refine date selection logic in app.py for improved clarity

Browse files

- Updated the date selection dropdown to first extract unique dates and then sort them in descending order, enhancing the user experience by ensuring the most recent contests are prioritized.
- Maintained the existing functionality for contest name retrieval based on the selected date, ensuring consistency in data handling.

Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -58,7 +58,9 @@ with tab1:
58
  contest_names, contest_id_map, curr_info = grab_contest_names(db, sport_select)
59
 
60
  with col3:
61
- date_select = st.selectbox("Select Date", curr_info['Date'].unique().sort_values(ascending=False), key='date_select')
 
 
62
 
63
  name_parse = curr_info[curr_info['Date'] == date_select]['Contest Name'].reset_index(drop=True)
64
  date_select = date_select.replace('-', '')
 
58
  contest_names, contest_id_map, curr_info = grab_contest_names(db, sport_select)
59
 
60
  with col3:
61
+ date_list_raw = curr_info['Date'].unique()
62
+ date_list = date_list_raw.sort_values(ascending=False)
63
+ date_select = st.selectbox("Select Date", date_list, key='date_select')
64
 
65
  name_parse = curr_info[curr_info['Date'] == date_select]['Contest Name'].reset_index(drop=True)
66
  date_select = date_select.replace('-', '')