Spaces:
Running
Running
James McCool
commited on
Commit
·
aa508ab
1
Parent(s):
741d267
Add Stack Priority filtering option in app.py to enhance user control over scoring percentages display. Users can now isolate data based on specific Stack Priority selections, improving data analysis capabilities.
Browse files
app.py
CHANGED
@@ -280,7 +280,12 @@ with tab1:
|
|
280 |
with st.expander("Info and Filters"):
|
281 |
with st.container():
|
282 |
slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Turbo Slate'), key='slate_var1')
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
284 |
|
285 |
if site_var == 'Draftkings':
|
286 |
if slate_var1 == 'Main Slate':
|
@@ -360,6 +365,8 @@ with tab1:
|
|
360 |
scoring_percentages = scoring_percentages.set_index('Names', drop=True)
|
361 |
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Own%']).format(game_format, precision=2), height=750, use_container_width = True)
|
362 |
elif view_var == "Advanced":
|
|
|
|
|
363 |
scoring_percentages = scoring_percentages.set_index('Names', drop=True)
|
364 |
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Avg_Salary', 'Own%']).format(game_format, precision=2), height=750, use_container_width = True)
|
365 |
|
|
|
280 |
with st.expander("Info and Filters"):
|
281 |
with st.container():
|
282 |
slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Turbo Slate'), key='slate_var1')
|
283 |
+
prio_split = st.radio("Do you want to isolate a specific Stack Priority?", ('Yes', 'No'), key='prio_split')
|
284 |
+
if prio_split == 'Yes':
|
285 |
+
prio_var = st.radio("Which Stack Priority are you looking for?", ['Outfield', 'Infield'], key='prio_var')
|
286 |
+
else:
|
287 |
+
prio_var = None
|
288 |
+
|
289 |
|
290 |
if site_var == 'Draftkings':
|
291 |
if slate_var1 == 'Main Slate':
|
|
|
365 |
scoring_percentages = scoring_percentages.set_index('Names', drop=True)
|
366 |
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Own%']).format(game_format, precision=2), height=750, use_container_width = True)
|
367 |
elif view_var == "Advanced":
|
368 |
+
if prio_var is not None:
|
369 |
+
scoring_percentages = scoring_percentages[scoring_percentages['Stack_Prio'] == prio_var]
|
370 |
scoring_percentages = scoring_percentages.set_index('Names', drop=True)
|
371 |
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Avg_Salary', 'Own%']).format(game_format, precision=2), height=750, use_container_width = True)
|
372 |
|