Spaces:
Running
Running
James McCool
commited on
Commit
·
1a9629b
1
Parent(s):
667ae9b
Refine game_format by removing unused metrics and streamline subscription notice handling in scoring percentages
Browse files
app.py
CHANGED
|
@@ -16,8 +16,7 @@ def init_conn():
|
|
| 16 |
|
| 17 |
db = init_conn()
|
| 18 |
|
| 19 |
-
game_format = {'Win%': '{:.2%}','First Inning Lead Percentage': '{:.2%}'
|
| 20 |
-
'Fifth Inning Lead Percentage': '{:.2%}', '8+ Runs': '{:.2%}', 'LevX': '{:.2%}'}
|
| 21 |
|
| 22 |
player_roo_format = {'Top_finish': '{:.2%}','Top_5_finish': '{:.2%}', 'Top_10_finish': '{:.2%}', '20+%': '{:.2%}', '2x%': '{:.2%}', '3x%': '{:.2%}',
|
| 23 |
'4x%': '{:.2%}'}
|
|
@@ -356,15 +355,14 @@ with tab1:
|
|
| 356 |
|
| 357 |
if view_var == "Simple":
|
| 358 |
scoring_percentages = scoring_percentages[['Names', 'Runs', '8+ Runs', 'Win%', 'LevX', 'Own%']]
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height=750, use_container_width = True)
|
| 363 |
elif view_var == "Advanced":
|
| 364 |
-
for col in ['Avg Fifth Inning', 'Fifth Inning Lead Percentage', 'Top Score', '8+ Runs', 'LevX', 'Own%']:
|
| 365 |
scoring_percentages[col] = '$$ (subscription only)'
|
| 366 |
scoring_percentages = scoring_percentages.set_index('Names', drop=True)
|
| 367 |
-
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height=750, use_container_width = True)
|
| 368 |
|
| 369 |
with tab2:
|
| 370 |
st.header("Player ROO")
|
|
|
|
| 16 |
|
| 17 |
db = init_conn()
|
| 18 |
|
| 19 |
+
game_format = {'Win%': '{:.2%}','First Inning Lead Percentage': '{:.2%}'}
|
|
|
|
| 20 |
|
| 21 |
player_roo_format = {'Top_finish': '{:.2%}','Top_5_finish': '{:.2%}', 'Top_10_finish': '{:.2%}', '20+%': '{:.2%}', '2x%': '{:.2%}', '3x%': '{:.2%}',
|
| 22 |
'4x%': '{:.2%}'}
|
|
|
|
| 355 |
|
| 356 |
if view_var == "Simple":
|
| 357 |
scoring_percentages = scoring_percentages[['Names', 'Runs', '8+ Runs', 'Win%', 'LevX', 'Own%']]
|
| 358 |
+
for col in ['Names', '8+ Runs', 'LevX', 'Own%']:
|
| 359 |
+
scoring_percentages[col] = '$$ (subscription only)'
|
| 360 |
+
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), height=750, use_container_width = True)
|
|
|
|
| 361 |
elif view_var == "Advanced":
|
| 362 |
+
for col in ['Names', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage', 'Top Score', '8+ Runs', 'LevX', 'Own%']:
|
| 363 |
scoring_percentages[col] = '$$ (subscription only)'
|
| 364 |
scoring_percentages = scoring_percentages.set_index('Names', drop=True)
|
| 365 |
+
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), height=750, use_container_width = True)
|
| 366 |
|
| 367 |
with tab2:
|
| 368 |
st.header("Player ROO")
|