Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,11 @@ gcservice_account = init_conn()
|
|
49 |
NBAGetGameData = 'https://docs.google.com/spreadsheets/d/1tRQrF_I5rS7Q0g9vE8NrENDZ2P3_DvtbBZzKEakwOI0/edit#gid=1373653837'
|
50 |
NBABettingModel = 'https://docs.google.com/spreadsheets/d/1WBnvOHQi_zVTGF63efejK5ho02AY00HiYrMHnMJXY1E/edit#gid=1157978351'
|
51 |
|
|
|
|
|
|
|
|
|
|
|
52 |
@st.cache_resource(ttl = 300)
|
53 |
def init_baselines():
|
54 |
sh = gcservice_account.open_by_url(NBABettingModel)
|
@@ -115,7 +120,7 @@ with tab2:
|
|
115 |
season_model = season_model[season_model['Team'].isin(team_var2)]
|
116 |
season_display = season_model.set_index('Team')
|
117 |
season_display = season_display.sort_values(by=['Win Projection Now'], ascending=False)
|
118 |
-
st.dataframe(season_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
119 |
st.download_button(
|
120 |
label="Export Futures Model",
|
121 |
data=convert_df_to_csv(season_model),
|
|
|
49 |
NBAGetGameData = 'https://docs.google.com/spreadsheets/d/1tRQrF_I5rS7Q0g9vE8NrENDZ2P3_DvtbBZzKEakwOI0/edit#gid=1373653837'
|
50 |
NBABettingModel = 'https://docs.google.com/spreadsheets/d/1WBnvOHQi_zVTGF63efejK5ho02AY00HiYrMHnMJXY1E/edit#gid=1157978351'
|
51 |
|
52 |
+
percentages_format = {'Playoff Odds': '{:.2%}', 'Division Odds': '{:.2%}', 'Top 4 Seed Odds': '{:.2%}', '1 Seed Odds': '{:.2%}', 'Win 1st Round': '{:.2%}',
|
53 |
+
'Win 2nd Round': '{:.2%}', 'Win Conference': '{:.2%}', 'Win Title': '{:.2%}', '1': '{:.2%}', '2': '{:.2%}', '3': '{:.2%}',
|
54 |
+
'4': '{:.2%}', '5': '{:.2%}', '6': '{:.2%}', '7': '{:.2%}', '8': '{:.2%}', '9': '{:.2%}', '10': '{:.2%}', '11': '{:.2%}',
|
55 |
+
'12': '{:.2%}', '13': '{:.2%}', '14': '{:.2%}', '15': '{:.2%}'}
|
56 |
+
|
57 |
@st.cache_resource(ttl = 300)
|
58 |
def init_baselines():
|
59 |
sh = gcservice_account.open_by_url(NBABettingModel)
|
|
|
120 |
season_model = season_model[season_model['Team'].isin(team_var2)]
|
121 |
season_display = season_model.set_index('Team')
|
122 |
season_display = season_display.sort_values(by=['Win Projection Now'], ascending=False)
|
123 |
+
st.dataframe(season_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
124 |
st.download_button(
|
125 |
label="Export Futures Model",
|
126 |
data=convert_df_to_csv(season_model),
|