Multichem commited on
Commit
a9f73f8
·
verified ·
1 Parent(s): 6edca36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -93,21 +93,21 @@ def init_baselines():
93
  'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy', 'FPPM',
94
  'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch', 'team_score', 'opp_score', 'spread'], axis=1)
95
 
96
- collection = db["rotations"]
97
- cursor = collection.find() # Finds all documents in the collection
98
-
99
- raw_display = pd.DataFrame(list(cursor))
 
100
  rot_table = raw_display[raw_display['Player'] != ""]
101
  rot_table = rot_table[['Player', 'Team', 'PG', 'SG', 'SF', 'PF', 'C', 'Given Pos']]
102
  data_cols = ['PG', 'SG', 'SF', 'PF', 'C']
103
  rot_table[data_cols] = rot_table[data_cols].apply(pd.to_numeric, errors='coerce')
104
  rot_table = rot_table[rot_table['Player'] != 0]
105
 
106
- worksheet = sh.worksheet('Rotation_stats')
107
- raw_display = pd.DataFrame(worksheet.get_values())
108
- raw_display.columns = raw_display.iloc[0]
109
- raw_display = raw_display[1:]
110
- raw_display = raw_display.reset_index(drop=True)
111
  game_rot = raw_display[raw_display['PLAYER_NAME'] != ""]
112
  data_cols = game_rot.columns.drop(['PLAYER_NAME', 'POS', 'TEAM_ABBREVIATION', 'OPP_ABBREVIATION', 'TEAM_NAME', 'OPP_NAME', 'GAME_DATE',
113
  'MATCHUP', 'WL', 'backlog_lookup', 'Task', 'game_players'])
 
93
  'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy', 'FPPM',
94
  'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch', 'team_score', 'opp_score', 'spread'], axis=1)
95
 
96
+ worksheet = sh.worksheet('Rotations')
97
+ raw_display = pd.DataFrame(worksheet.get_values())
98
+ raw_display.columns = raw_display.iloc[0]
99
+ raw_display = raw_display[1:]
100
+ raw_display = raw_display.reset_index(drop=True)
101
  rot_table = raw_display[raw_display['Player'] != ""]
102
  rot_table = rot_table[['Player', 'Team', 'PG', 'SG', 'SF', 'PF', 'C', 'Given Pos']]
103
  data_cols = ['PG', 'SG', 'SF', 'PF', 'C']
104
  rot_table[data_cols] = rot_table[data_cols].apply(pd.to_numeric, errors='coerce')
105
  rot_table = rot_table[rot_table['Player'] != 0]
106
 
107
+ collection = db["rotations"]
108
+ cursor = collection.find() # Finds all documents in the collection
109
+
110
+ raw_display = pd.DataFrame(list(cursor))
 
111
  game_rot = raw_display[raw_display['PLAYER_NAME'] != ""]
112
  data_cols = game_rot.columns.drop(['PLAYER_NAME', 'POS', 'TEAM_ABBREVIATION', 'OPP_ABBREVIATION', 'TEAM_NAME', 'OPP_NAME', 'GAME_DATE',
113
  'MATCHUP', 'WL', 'backlog_lookup', 'Task', 'game_players'])