James McCool
commited on
Commit
·
b7d52cb
1
Parent(s):
69b4090
Enhance slate selection functionality in Streamlit app by introducing conditional loading of data based on slate type. Users can now choose between 'Regular' and 'Showdown' slates, with corresponding data sources for Draftkings and Fanduel, improving user experience and data management.
Browse files- src/streamlit_app.py +12 -3
src/streamlit_app.py
CHANGED
|
@@ -882,13 +882,22 @@ if selected_tab == 'Player ROO':
|
|
| 882 |
with st.expander("Info and Filters"):
|
| 883 |
st.info(t_stamp)
|
| 884 |
slate_type_var2 = st.radio("Which slate type are you loading?", ('Regular', 'Showdown'), key='slate_type_var2_radio')
|
| 885 |
-
|
|
|
|
|
|
|
|
|
|
| 886 |
if site_var == 'Draftkings':
|
| 887 |
-
|
|
|
|
|
|
|
|
|
|
| 888 |
|
| 889 |
raw_baselines = raw_baselines.iloc[:,:-2]
|
| 890 |
elif site_var == 'Fanduel':
|
| 891 |
-
|
|
|
|
|
|
|
|
|
|
| 892 |
raw_baselines = raw_baselines.iloc[:,:-2]
|
| 893 |
split_var2 = st.radio("Would you like to view the whole slate or just specific games?", ('Full Slate Run', 'Specific Games'), key='split_var2_radio')
|
| 894 |
if split_var2 == 'Specific Games':
|
|
|
|
| 882 |
with st.expander("Info and Filters"):
|
| 883 |
st.info(t_stamp)
|
| 884 |
slate_type_var2 = st.radio("Which slate type are you loading?", ('Regular', 'Showdown'), key='slate_type_var2_radio')
|
| 885 |
+
if slate_type_var2 == 'Regular':
|
| 886 |
+
slate_var2 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Late Slate', 'Thurs-Mon Slate'), key='slate_var2_radio')
|
| 887 |
+
elif slate_type_var2 == 'Showdown':
|
| 888 |
+
slate_var2 = st.radio("Which data are you loading?", ("Showdown #1", "Showdown #2", "Showdown #3"), key='slate_var2_radio')
|
| 889 |
if site_var == 'Draftkings':
|
| 890 |
+
if slate_type_var2 == 'Regular':
|
| 891 |
+
raw_baselines = dk_roo_raw[dk_roo_raw['slate'] == str(slate_var2)]
|
| 892 |
+
elif slate_type_var2 == 'Showdown':
|
| 893 |
+
raw_baselines = dk_sd_roo_raw[dk_sd_roo_raw['slate'] == str(slate_var2)]
|
| 894 |
|
| 895 |
raw_baselines = raw_baselines.iloc[:,:-2]
|
| 896 |
elif site_var == 'Fanduel':
|
| 897 |
+
if slate_type_var2 == 'Regular':
|
| 898 |
+
raw_baselines = fd_roo_raw[fd_roo_raw['slate'] == str(slate_var2)]
|
| 899 |
+
elif slate_type_var2 == 'Showdown':
|
| 900 |
+
raw_baselines = fd_sd_roo_raw[fd_sd_roo_raw['slate'] == str(slate_var2)]
|
| 901 |
raw_baselines = raw_baselines.iloc[:,:-2]
|
| 902 |
split_var2 = st.radio("Would you like to view the whole slate or just specific games?", ('Full Slate Run', 'Specific Games'), key='split_var2_radio')
|
| 903 |
if split_var2 == 'Specific Games':
|