James McCool
commited on
Commit
·
532574b
1
Parent(s):
c5bdf9d
Refine contest name selection in app.py for improved data handling
Browse files- Updated the logic for contest name retrieval to reset the index, ensuring consistent data formatting.
- Modified the contest file helper to use the first entry of the parsed contest names, enhancing the accuracy of data processing during uploads.
app.py
CHANGED
@@ -62,8 +62,7 @@ with tab1:
|
|
62 |
with col3:
|
63 |
date_select = st.selectbox("Select Date", curr_info['Date'].unique(), key='date_select')
|
64 |
|
65 |
-
name_parse = curr_info[curr_info['Date'] == date_select]['Contest Name']
|
66 |
-
print(name_parse)
|
67 |
date_select = date_select.replace('-', '')
|
68 |
with col4:
|
69 |
type_var = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_var')
|
@@ -82,7 +81,7 @@ with tab1:
|
|
82 |
elif parse_type == 'Manual':
|
83 |
st.session_state.clear()
|
84 |
st.session_state['Contest_file'] = st.file_uploader("Upload Contest File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
|
85 |
-
st.session_state['Contest_file_helper'] = grab_contest_data(sport_select, name_parse, contest_id_map, date_select)
|
86 |
if 'Contest' in st.session_state:
|
87 |
del st.session_state['Contest']
|
88 |
|
|
|
62 |
with col3:
|
63 |
date_select = st.selectbox("Select Date", curr_info['Date'].unique(), 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('-', '')
|
67 |
with col4:
|
68 |
type_var = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_var')
|
|
|
81 |
elif parse_type == 'Manual':
|
82 |
st.session_state.clear()
|
83 |
st.session_state['Contest_file'] = st.file_uploader("Upload Contest File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
|
84 |
+
st.session_state['Contest_file_helper'] = grab_contest_data(sport_select, name_parse.iloc[0], contest_id_map, date_select)
|
85 |
if 'Contest' in st.session_state:
|
86 |
del st.session_state['Contest']
|
87 |
|