Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,6 +51,8 @@ def init_baselines():
|
|
| 51 |
gamelog_table = gamelog_table[['PLAYER_NAME', 'POS', 'TEAM_NAME', 'OPP_NAME', 'SEASON_ID', 'GAME_DATE', 'MATCHUP', 'MIN', 'touches', 'PTS', 'FGM', 'FGA', 'FG_PCT', 'FG3M', 'FG3A',
|
| 52 |
'FG3_PCT', 'FTM', 'FTA', 'FT_PCT', 'reboundChancesOffensive', 'OREB', 'reboundChancesDefensive', 'DREB', 'reboundChancesTotal', 'REB',
|
| 53 |
'passes', 'secondaryAssists', 'freeThrowAssists', 'assists', 'STL', 'BLK', 'TOV', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy']]
|
|
|
|
|
|
|
| 54 |
gamelog_table['assists'].replace("", 0, inplace=True)
|
| 55 |
gamelog_table['reboundChancesTotal'].replace("", 0, inplace=True)
|
| 56 |
gamelog_table['passes'].replace("", 0, inplace=True)
|
|
@@ -78,7 +80,7 @@ def init_baselines():
|
|
| 78 |
gamelog_table = gamelog_table.set_axis(['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 79 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 80 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 81 |
-
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch'], axis=1)
|
| 82 |
|
| 83 |
worksheet = sh.worksheet('Rotations')
|
| 84 |
raw_display = pd.DataFrame(worksheet.get_values())
|
|
@@ -195,7 +197,7 @@ def convert_df_to_csv(df):
|
|
| 195 |
gamelog_table, rot_table = init_baselines()
|
| 196 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 197 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 198 |
-
data_cols = ['Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 199 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 200 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 201 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
@@ -221,7 +223,7 @@ with tab1:
|
|
| 221 |
gamelog_table, rot_table = init_baselines()
|
| 222 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 223 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 224 |
-
data_cols = ['Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 225 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 226 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 227 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
@@ -339,7 +341,7 @@ with tab2:
|
|
| 339 |
gamelog_table, rot_table = init_baselines()
|
| 340 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 341 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 342 |
-
data_cols = ['Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 343 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 344 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 345 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
@@ -423,7 +425,7 @@ with tab3:
|
|
| 423 |
gamelog_table, rot_table = init_baselines()
|
| 424 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 425 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 426 |
-
data_cols = ['Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 427 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 428 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 429 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
@@ -501,7 +503,7 @@ with tab4:
|
|
| 501 |
gamelog_table, rot_table = init_baselines()
|
| 502 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 503 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 504 |
-
data_cols = ['Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 505 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 506 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 507 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
|
|
| 51 |
gamelog_table = gamelog_table[['PLAYER_NAME', 'POS', 'TEAM_NAME', 'OPP_NAME', 'SEASON_ID', 'GAME_DATE', 'MATCHUP', 'MIN', 'touches', 'PTS', 'FGM', 'FGA', 'FG_PCT', 'FG3M', 'FG3A',
|
| 52 |
'FG3_PCT', 'FTM', 'FTA', 'FT_PCT', 'reboundChancesOffensive', 'OREB', 'reboundChancesDefensive', 'DREB', 'reboundChancesTotal', 'REB',
|
| 53 |
'passes', 'secondaryAssists', 'freeThrowAssists', 'assists', 'STL', 'BLK', 'TOV', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy']]
|
| 54 |
+
gamelog_table['spread'] = (gamelog_table.groupby(['TEAM_NAME', 'GAME_DATE'], sort=False)['PTS'].transform('sum') -
|
| 55 |
+
gamelog_table.groupby(['OPP_NAME', 'GAME_DATE'], sort=False)['PTS'].transform('sum'))
|
| 56 |
gamelog_table['assists'].replace("", 0, inplace=True)
|
| 57 |
gamelog_table['reboundChancesTotal'].replace("", 0, inplace=True)
|
| 58 |
gamelog_table['passes'].replace("", 0, inplace=True)
|
|
|
|
| 80 |
gamelog_table = gamelog_table.set_axis(['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 81 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 82 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 83 |
+
'spread', 'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch'], axis=1)
|
| 84 |
|
| 85 |
worksheet = sh.worksheet('Rotations')
|
| 86 |
raw_display = pd.DataFrame(worksheet.get_values())
|
|
|
|
| 197 |
gamelog_table, rot_table = init_baselines()
|
| 198 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 199 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 200 |
+
data_cols = ['spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 201 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 202 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 203 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
|
|
| 223 |
gamelog_table, rot_table = init_baselines()
|
| 224 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 225 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 226 |
+
data_cols = ['spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 227 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 228 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 229 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
|
|
| 341 |
gamelog_table, rot_table = init_baselines()
|
| 342 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 343 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 344 |
+
data_cols = ['spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 345 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 346 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 347 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
|
|
| 425 |
gamelog_table, rot_table = init_baselines()
|
| 426 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 427 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 428 |
+
data_cols = ['spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 429 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 430 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 431 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|
|
|
|
| 503 |
gamelog_table, rot_table = init_baselines()
|
| 504 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
| 505 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
| 506 |
+
data_cols = ['spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
| 507 |
'FG3A', 'FG3%', 'FTM', 'FTA', 'FT%', 'OREB Chance', 'OREB', 'DREB Chance', 'DREB', 'REB Chance', 'REB',
|
| 508 |
'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy',
|
| 509 |
'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch']
|