BraydenMoore commited on
Commit
18423ba
·
1 Parent(s): fa670d6
Files changed (1) hide show
  1. Source/Predict/predict.py +2 -0
Source/Predict/predict.py CHANGED
@@ -68,12 +68,14 @@ def get_one_week(home,away,season,week):
68
  home_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
69
  home_df = home_df[[i for i in home_df.columns if '.Away' not in i] if gbg_home_team==home else [i for i in home_df.columns if '.Away' in i]]
70
  home_df.columns = [i.replace('.Away','') for i in home_df.columns]
 
71
 
72
  away_df = gbg.loc[((gbg['away_team']==away) | (gbg['home_team']==away)) & (gbg['Season']==season) & (gbg['GP']==week-1)]
73
  gbg_home_team = away_df['home_team'].item()
74
  away_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
75
  away_df = away_df[[i for i in away_df.columns if '.Away' not in i] if gbg_home_team==away else [i for i in away_df.columns if '.Away' in i]]
76
  away_df.columns = [i.replace('.Away','') + '.Away' for i in away_df.columns]
 
77
 
78
  df = home_df.merge(away_df, left_on='GP', right_on='GP.Away')
79
  print(df.columns)
 
68
  home_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
69
  home_df = home_df[[i for i in home_df.columns if '.Away' not in i] if gbg_home_team==home else [i for i in home_df.columns if '.Away' in i]]
70
  home_df.columns = [i.replace('.Away','') for i in home_df.columns]
71
+ print(home_df)
72
 
73
  away_df = gbg.loc[((gbg['away_team']==away) | (gbg['home_team']==away)) & (gbg['Season']==season) & (gbg['GP']==week-1)]
74
  gbg_home_team = away_df['home_team'].item()
75
  away_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
76
  away_df = away_df[[i for i in away_df.columns if '.Away' not in i] if gbg_home_team==away else [i for i in away_df.columns if '.Away' in i]]
77
  away_df.columns = [i.replace('.Away','') + '.Away' for i in away_df.columns]
78
+ print(away_df)
79
 
80
  df = home_df.merge(away_df, left_on='GP', right_on='GP.Away')
81
  print(df.columns)