Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -48,13 +48,8 @@ gcservice_account, gcservice_account2 = init_conn()
|
|
48 |
wrong_acro = ['AZ', 'WSN', 'TBR', 'KCR', 'SDP', 'CHW', 'SFG']
|
49 |
right_acro = ['ARI', 'WSH', 'TB', 'KC', 'SD', 'CWS', 'SF']
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
BP_league_format = ['Strikeoutper', 'Walkper','xBA', 'xSLG', 'BABIP', 'xwOBA', 'AVG', 'HWS Ratio']
|
54 |
-
hitter_format = {'K%': '{:.2%}', 'xHR/PA': '{:.2%}', 'Event/PA': '{:.2%}'}
|
55 |
-
offense_format = {'8+ For': '{:.2%}', '8+ For L5': '{:.2%}', '8+ For L10': '{:.2%}', 'Trending 8+ For': '{:.2%}'}
|
56 |
-
defense_format = {'8+ Allowed': '{:.2%}', '8+ Allowed L5': '{:.2%}', '8+ Allowed L10': '{:.2%}', 'Trending 8+ Allowed': '{:.2%}'}
|
57 |
-
R2_format = {'R2_to_Opp_szn': '{:.2%}', 'R2_to_Opp_sample': '{:.2%}', 'R2_to_Opp L5': '{:.2%}', 'R2_to_Opp L10': '{:.2%}', 'R2_to_Opp_Trend': '{:.2%}'}
|
58 |
|
59 |
data_hold = 'https://docs.google.com/spreadsheets/d/1f42Ergav8K1VsOLOK9MUn7DM_MLMvv4GR2Fy7EfnZTc/edit#gid=500994479'
|
60 |
|
@@ -102,7 +97,7 @@ if st.button("Reset Data", key='reset1'):
|
|
102 |
load_display, t_stamp = load_matchups()
|
103 |
|
104 |
overall_display = load_display
|
105 |
-
st.dataframe(overall_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
106 |
|
107 |
st.download_button(
|
108 |
label="Export Tables",
|
|
|
48 |
wrong_acro = ['AZ', 'WSN', 'TBR', 'KCR', 'SDP', 'CHW', 'SFG']
|
49 |
right_acro = ['ARI', 'WSH', 'TB', 'KC', 'SD', 'CWS', 'SF']
|
50 |
|
51 |
+
disp_format = {'8+ For': '{:.2%}', '8+ For L5': '{:.2%}', '8+ For L10': '{:.2%}', 'Trending 8+ For': '{:.2%}', 'Matchup 8+ Trend': '{:.2%}',
|
52 |
+
'R2_to_Opp_szn': '{:.2%}', 'R2_to_Opp_sample': '{:.2%}', 'R2_to_Opp L5': '{:.2%}', 'R2_to_Opp L10': '{:.2%}', 'R2_to_Opp_Trend': '{:.2%}'}
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
data_hold = 'https://docs.google.com/spreadsheets/d/1f42Ergav8K1VsOLOK9MUn7DM_MLMvv4GR2Fy7EfnZTc/edit#gid=500994479'
|
55 |
|
|
|
97 |
load_display, t_stamp = load_matchups()
|
98 |
|
99 |
overall_display = load_display
|
100 |
+
st.dataframe(overall_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(disp_format, precision=2), use_container_width = True)
|
101 |
|
102 |
st.download_button(
|
103 |
label="Export Tables",
|