Multichem commited on
Commit
958e2d1
·
verified ·
1 Parent(s): cf6815f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -206,6 +206,7 @@ with tab7:
206
  worksheet = sh.worksheet('Add games')
207
  add_games_df = DataFrame(worksheet.get_all_records())
208
  add_games_df.replace('', np.nan, inplace=True)
 
209
 
210
  time.sleep(.5)
211
 
@@ -362,7 +363,8 @@ with tab7:
362
  df_cleaned['Away_PFA_cond'] = (df_cleaned['cond_away_PFA'] * .75 + df_cleaned['cond_home_PAA'] * .25)
363
  df_cleaned['Home_PFA_cond'] = (df_cleaned['cond_home_PFA'] * .75 + df_cleaned['cond_away_PAA'] * .25)
364
 
365
- df_cleaned['HFA'] = df_cleaned['Home'].map(hfa_dict)
 
366
  df_cleaned['Neutral'] = np.nan
367
  df_cleaned['Home Spread'] = ((df_cleaned['Home_ATL'] - df_cleaned['Away_ATL']) + df_cleaned['HFA']) * -1
368
  df_cleaned['Win Prob'] = df_cleaned['Home Spread'].map(odds_dict)
 
206
  worksheet = sh.worksheet('Add games')
207
  add_games_df = DataFrame(worksheet.get_all_records())
208
  add_games_df.replace('', np.nan, inplace=True)
209
+ neutral_dict = dict(zip(add_games_df.game_id, add_games_df.Neutral))
210
 
211
  time.sleep(.5)
212
 
 
363
  df_cleaned['Away_PFA_cond'] = (df_cleaned['cond_away_PFA'] * .75 + df_cleaned['cond_home_PAA'] * .25)
364
  df_cleaned['Home_PFA_cond'] = (df_cleaned['cond_home_PFA'] * .75 + df_cleaned['cond_away_PAA'] * .25)
365
 
366
+ df_cleaned['Neutral'] = df_cleaned['game_id'].map(neutral_dict)
367
+ df_cleaned['HFA'] = np.where(df_cleaned['Neutral'] == 1, 0, df_cleaned['Home'].map(hfa_dict))
368
  df_cleaned['Neutral'] = np.nan
369
  df_cleaned['Home Spread'] = ((df_cleaned['Home_ATL'] - df_cleaned['Away_ATL']) + df_cleaned['HFA']) * -1
370
  df_cleaned['Win Prob'] = df_cleaned['Home Spread'].map(odds_dict)