Spaces:
Running
Running
James McCool
commited on
Commit
·
cf9e7c2
1
Parent(s):
6fa8eec
Implement conditional display for scoring percentages in app.py, allowing users to choose between 'Simple' and 'Advanced' views, enhancing data presentation and user experience.
Browse files
app.py
CHANGED
@@ -140,7 +140,11 @@ with tab1:
|
|
140 |
with col4:
|
141 |
own_var1 = st.radio("How would you like to display team ownership?", ('Sum', 'Average'), key='own_var1')
|
142 |
st.title("Scoring Percentages")
|
143 |
-
|
|
|
|
|
|
|
|
|
144 |
|
145 |
with tab2:
|
146 |
st.title("Player ROO")
|
|
|
140 |
with col4:
|
141 |
own_var1 = st.radio("How would you like to display team ownership?", ('Sum', 'Average'), key='own_var1')
|
142 |
st.title("Scoring Percentages")
|
143 |
+
if view_var == "Simple":
|
144 |
+
scoring_percentages = scoring_percentages[['Names', 'Avg Score', '8+ runs', 'Win Percentage']]
|
145 |
+
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), height=750, use_container_width = True, hide_index=True)
|
146 |
+
elif view_var == "Advanced":
|
147 |
+
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), height=750, use_container_width = True, hide_index=True)
|
148 |
|
149 |
with tab2:
|
150 |
st.title("Player ROO")
|