James McCool commited on
Commit
ba1b862
·
1 Parent(s): d2a2324

Added support for O/U and vegas info to NBA betting model

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -94,7 +94,8 @@ def init_baselines():
94
  cursor = collection.find()
95
 
96
  raw_display = pd.DataFrame(list(cursor))
97
- raw_display = raw_display[['Team', 'Opp', 'Team Points', 'Opp Points', 'Proj Total', 'Proj Winner', 'Proj Spread', 'Paydirt W Spread', 'Vegas W Spread', 'Paydirt Win%', 'Paydirt Odds']]
 
98
  raw_display.replace('#DIV/0!', np.nan, inplace=True)
99
  game_model = raw_display.dropna()
100
 
@@ -165,11 +166,11 @@ with tab1:
165
  line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
166
  team_frame = game_model
167
  if line_var1 == 'Percentage':
168
- team_frame = team_frame[['Team', 'Opp', 'Team Points', 'Opp Points', 'Proj Total', 'Proj Winner', 'Proj Spread', 'Paydirt W Spread', 'Vegas W Spread', 'Paydirt Win%']]
169
  team_frame = team_frame.set_index('Team')
170
  st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
171
  if line_var1 == 'American':
172
- team_frame = team_frame[['Team', 'Opp', 'Team Points', 'Opp Points', 'Proj Total', 'Proj Winner', 'Proj Spread', 'Paydirt W Spread', 'Vegas W Spread', 'Paydirt Odds']]
173
  team_frame = team_frame.set_index('Team')
174
  st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
175
 
 
94
  cursor = collection.find()
95
 
96
  raw_display = pd.DataFrame(list(cursor))
97
+ raw_display = raw_display[['Team', 'Opp', 'PD Team Points', 'PD Opp Points', 'VEG Team Points', 'VEG Opp Points', 'PD Proj Total', 'VEG Proj Total', 'PD Over%', 'PD Over Odds', 'PD Under%', 'PD Under Odds',
98
+ 'PD Proj Winner', 'PD Proj Spread', 'PD W Spread', 'VEG W Spread', 'PD Win%', 'PD Odds']]
99
  raw_display.replace('#DIV/0!', np.nan, inplace=True)
100
  game_model = raw_display.dropna()
101
 
 
166
  line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
167
  team_frame = game_model
168
  if line_var1 == 'Percentage':
169
+ team_frame = team_frame[['Team', 'Opp', 'PD Team Points', 'PD Opp Points', 'VEG Team Points', 'VEG Opp Points', 'PD Proj Total', 'VEG Proj Total', 'PD Over%', 'PD Under%', 'PD Proj Winner', 'PD Proj Spread', 'PD W Spread', 'VEG W Spread', 'PD Win%']]
170
  team_frame = team_frame.set_index('Team')
171
  st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
172
  if line_var1 == 'American':
173
+ team_frame = team_frame[['Team', 'Opp', 'PD Team Points', 'PD Opp Points', 'VEG Team Points', 'VEG Opp Points', 'PD Proj Total', 'VEG Proj Total', 'PD Over Odds', 'PD Under Odds', 'PD Proj Winner', 'PD Proj Spread', 'PD W Spread', 'VEG W Spread', 'PD Odds']]
174
  team_frame = team_frame.set_index('Team')
175
  st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
176