Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,7 +53,7 @@ def init_baselines():
|
|
| 53 |
gamelog_table['reboundChancesTotal'].replace("", 0, inplace=True)
|
| 54 |
gamelog_table['passes'].replace("", 0, inplace=True)
|
| 55 |
gamelog_table['touches'].replace("", 0, inplace=True)
|
| 56 |
-
gamelog_table['MIN'].replace("", 0, inplace=True)
|
| 57 |
gamelog_table['Fantasy'].replace("", 0, inplace=True)
|
| 58 |
gamelog_table['FD_Fantasy'].replace("", 0, inplace=True)
|
| 59 |
gamelog_table['REB'] = gamelog_table['REB'].astype(int)
|
|
@@ -61,7 +61,7 @@ def init_baselines():
|
|
| 61 |
gamelog_table['reboundChancesTotal'] = gamelog_table['reboundChancesTotal'].astype(int)
|
| 62 |
gamelog_table['passes'] = gamelog_table['passes'].astype(int)
|
| 63 |
gamelog_table['touches'] = gamelog_table['touches'].astype(int)
|
| 64 |
-
gamelog_table['MIN'] = gamelog_table['MIN'].astype(
|
| 65 |
gamelog_table['Fantasy'] = gamelog_table['Fantasy'].astype(float)
|
| 66 |
gamelog_table['FD_Fantasy'] = gamelog_table['FD_Fantasy'].astype(float)
|
| 67 |
gamelog_table['rebound%'] = gamelog_table['REB'] / gamelog_table['reboundChancesTotal']
|
|
@@ -85,6 +85,8 @@ def seasonlong_build(data_sample):
|
|
| 85 |
season_long_table = data_sample[['Player', 'Pos', 'Team']]
|
| 86 |
season_long_table['Min'] = data_sample.groupby(['Player', 'Season'], sort=False)['Min'].transform('mean').astype(float)
|
| 87 |
season_long_table['Touches'] = data_sample.groupby(['Player', 'Season'], sort=False)['Touches'].transform('mean').astype(float)
|
|
|
|
|
|
|
| 88 |
season_long_table['Pts'] = data_sample.groupby(['Player', 'Season'], sort=False)['Pts'].transform('mean').astype(float)
|
| 89 |
season_long_table['FGM'] = data_sample.groupby(['Player', 'Season'], sort=False)['FGM'].transform('mean').astype(float)
|
| 90 |
season_long_table['FGA'] = data_sample.groupby(['Player', 'Season'], sort=False)['FGA'].transform('mean').astype(float)
|
|
@@ -120,8 +122,6 @@ def seasonlong_build(data_sample):
|
|
| 120 |
data_sample.groupby(['Player', 'Season'], sort=False)['REB Chance'].transform('sum').astype(int))
|
| 121 |
season_long_table['Assists/Pass'] = (data_sample.groupby(['Player', 'Season'], sort=False)['Assists'].transform('sum').astype(int) /
|
| 122 |
data_sample.groupby(['Player', 'Season'], sort=False)['Passes'].transform('sum').astype(int))
|
| 123 |
-
season_long_table['Touch/Min'] = (data_sample.groupby(['Player', 'Season'], sort=False)['Touches'].transform('sum').astype(int) /
|
| 124 |
-
data_sample.groupby(['Player', 'Season'], sort=False)['Min'].transform('sum').astype(int))
|
| 125 |
season_long_table['Fantasy/Touch'] = (data_sample.groupby(['Player', 'Season'], sort=False)['Fantasy'].transform('sum').astype(int) /
|
| 126 |
data_sample.groupby(['Player', 'Season'], sort=False)['Touches'].transform('sum').astype(int))
|
| 127 |
season_long_table['FD Fantasy/Touch'] = (data_sample.groupby(['Player', 'Season'], sort=False)['FD_Fantasy'].transform('sum').astype(int) /
|
|
|
|
| 53 |
gamelog_table['reboundChancesTotal'].replace("", 0, inplace=True)
|
| 54 |
gamelog_table['passes'].replace("", 0, inplace=True)
|
| 55 |
gamelog_table['touches'].replace("", 0, inplace=True)
|
| 56 |
+
# gamelog_table['MIN'].replace("", 0, inplace=True)
|
| 57 |
gamelog_table['Fantasy'].replace("", 0, inplace=True)
|
| 58 |
gamelog_table['FD_Fantasy'].replace("", 0, inplace=True)
|
| 59 |
gamelog_table['REB'] = gamelog_table['REB'].astype(int)
|
|
|
|
| 61 |
gamelog_table['reboundChancesTotal'] = gamelog_table['reboundChancesTotal'].astype(int)
|
| 62 |
gamelog_table['passes'] = gamelog_table['passes'].astype(int)
|
| 63 |
gamelog_table['touches'] = gamelog_table['touches'].astype(int)
|
| 64 |
+
gamelog_table['MIN'] = gamelog_table['MIN'].astype(int)
|
| 65 |
gamelog_table['Fantasy'] = gamelog_table['Fantasy'].astype(float)
|
| 66 |
gamelog_table['FD_Fantasy'] = gamelog_table['FD_Fantasy'].astype(float)
|
| 67 |
gamelog_table['rebound%'] = gamelog_table['REB'] / gamelog_table['reboundChancesTotal']
|
|
|
|
| 85 |
season_long_table = data_sample[['Player', 'Pos', 'Team']]
|
| 86 |
season_long_table['Min'] = data_sample.groupby(['Player', 'Season'], sort=False)['Min'].transform('mean').astype(float)
|
| 87 |
season_long_table['Touches'] = data_sample.groupby(['Player', 'Season'], sort=False)['Touches'].transform('mean').astype(float)
|
| 88 |
+
season_long_table['Touch/Min'] = (data_sample.groupby(['Player', 'Season'], sort=False)['Touches'].transform('sum').astype(int) /
|
| 89 |
+
data_sample.groupby(['Player', 'Season'], sort=False)['Min'].transform('sum').astype(int))
|
| 90 |
season_long_table['Pts'] = data_sample.groupby(['Player', 'Season'], sort=False)['Pts'].transform('mean').astype(float)
|
| 91 |
season_long_table['FGM'] = data_sample.groupby(['Player', 'Season'], sort=False)['FGM'].transform('mean').astype(float)
|
| 92 |
season_long_table['FGA'] = data_sample.groupby(['Player', 'Season'], sort=False)['FGA'].transform('mean').astype(float)
|
|
|
|
| 122 |
data_sample.groupby(['Player', 'Season'], sort=False)['REB Chance'].transform('sum').astype(int))
|
| 123 |
season_long_table['Assists/Pass'] = (data_sample.groupby(['Player', 'Season'], sort=False)['Assists'].transform('sum').astype(int) /
|
| 124 |
data_sample.groupby(['Player', 'Season'], sort=False)['Passes'].transform('sum').astype(int))
|
|
|
|
|
|
|
| 125 |
season_long_table['Fantasy/Touch'] = (data_sample.groupby(['Player', 'Season'], sort=False)['Fantasy'].transform('sum').astype(int) /
|
| 126 |
data_sample.groupby(['Player', 'Season'], sort=False)['Touches'].transform('sum').astype(int))
|
| 127 |
season_long_table['FD Fantasy/Touch'] = (data_sample.groupby(['Player', 'Season'], sort=False)['FD_Fantasy'].transform('sum').astype(int) /
|