Spaces:
Running
Running
James McCool
commited on
Commit
·
143d145
1
Parent(s):
7429340
Reformatting of game model
Browse files
app.py
CHANGED
|
@@ -53,7 +53,7 @@ gcservice_account, gcservice_account2 = init_conn()
|
|
| 53 |
|
| 54 |
master_hold = 'https://docs.google.com/spreadsheets/d/1Yq0vGriWK-bS79e-bD6_u9pqrYE6Yrlbb_wEkmH-ot0/edit#gid=853878325'
|
| 55 |
|
| 56 |
-
game_format = {'Win%': '{:.2%}'}
|
| 57 |
prop_format = {'L5 Success': '{:.2%}', 'L10_Success': '{:.2%}', 'L20_success': '{:.2%}', 'Matchup Boost': '{:.2%}', 'Trending Over': '{:.2%}', 'Trending Under': '{:.2%}',
|
| 58 |
'Implied Over': '{:.2%}', 'Implied Under': '{:.2%}', 'Over Edge': '{:.2%}', 'Under Edge': '{:.2%}'}
|
| 59 |
prop_table_options = ['NBA_GAME_PLAYER_POINTS', 'NBA_GAME_PLAYER_REBOUNDS', 'NBA_GAME_PLAYER_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS', 'NBA_GAME_PLAYER_POINTS_ASSISTS', 'NBA_GAME_PLAYER_REBOUNDS_ASSISTS']
|
|
@@ -154,13 +154,13 @@ with tab1:
|
|
| 154 |
line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
|
| 155 |
team_frame = game_model
|
| 156 |
if line_var1 == 'Percentage':
|
| 157 |
-
team_frame = team_frame[['Team', 'Opp', 'Team Points', 'Opp Points', 'Proj Total', 'Proj
|
| 158 |
team_frame = team_frame.set_index('Team')
|
| 159 |
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
|
| 160 |
if line_var1 == 'American':
|
| 161 |
-
team_frame = team_frame[['Team', 'Opp', 'Team Points', 'Opp Points', 'Proj Total', 'Proj
|
| 162 |
team_frame = team_frame.set_index('Team')
|
| 163 |
-
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
| 164 |
|
| 165 |
st.download_button(
|
| 166 |
label="Export Team Model",
|
|
|
|
| 53 |
|
| 54 |
master_hold = 'https://docs.google.com/spreadsheets/d/1Yq0vGriWK-bS79e-bD6_u9pqrYE6Yrlbb_wEkmH-ot0/edit#gid=853878325'
|
| 55 |
|
| 56 |
+
game_format = {'Paydirt Win%': '{:.2%}', 'Vegas Win%': '{:.2%}'}
|
| 57 |
prop_format = {'L5 Success': '{:.2%}', 'L10_Success': '{:.2%}', 'L20_success': '{:.2%}', 'Matchup Boost': '{:.2%}', 'Trending Over': '{:.2%}', 'Trending Under': '{:.2%}',
|
| 58 |
'Implied Over': '{:.2%}', 'Implied Under': '{:.2%}', 'Over Edge': '{:.2%}', 'Under Edge': '{:.2%}'}
|
| 59 |
prop_table_options = ['NBA_GAME_PLAYER_POINTS', 'NBA_GAME_PLAYER_REBOUNDS', 'NBA_GAME_PLAYER_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS', 'NBA_GAME_PLAYER_POINTS_ASSISTS', 'NBA_GAME_PLAYER_REBOUNDS_ASSISTS']
|
|
|
|
| 154 |
line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
|
| 155 |
team_frame = game_model
|
| 156 |
if line_var1 == 'Percentage':
|
| 157 |
+
team_frame = team_frame[['Team', 'Opp', 'Team Points', 'Opp Points', 'Proj Total', 'Proj Winner', 'Proj Spread', 'Paydirt W Spread', 'Vegas W Spread', 'Paydirt Win%']]
|
| 158 |
team_frame = team_frame.set_index('Team')
|
| 159 |
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
|
| 160 |
if line_var1 == 'American':
|
| 161 |
+
team_frame = team_frame[['Team', 'Opp', 'Team Points', 'Opp Points', 'Proj Total', 'Proj Winner', 'Proj Spread', 'Paydirt W Spread', 'Vegas W Spread', 'Paydirt Odds']]
|
| 162 |
team_frame = team_frame.set_index('Team')
|
| 163 |
+
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
|
| 164 |
|
| 165 |
st.download_button(
|
| 166 |
label="Export Team Model",
|