Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,8 @@ def init_baselines():
|
|
47 |
raw_display.columns = raw_display.iloc[0]
|
48 |
raw_display = raw_display[1:]
|
49 |
raw_display = raw_display.reset_index(drop=True)
|
50 |
-
|
|
|
51 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
52 |
raw_display['position'] = 'Point Guard'
|
53 |
pg_dem = raw_display[raw_display['Acro'] != ""]
|
@@ -57,7 +58,8 @@ def init_baselines():
|
|
57 |
raw_display.columns = raw_display.iloc[0]
|
58 |
raw_display = raw_display[1:]
|
59 |
raw_display = raw_display.reset_index(drop=True)
|
60 |
-
|
|
|
61 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
62 |
raw_display['position'] = 'Shooting Guard'
|
63 |
sg_dem = raw_display[raw_display['Acro'] != ""]
|
@@ -67,7 +69,8 @@ def init_baselines():
|
|
67 |
raw_display.columns = raw_display.iloc[0]
|
68 |
raw_display = raw_display[1:]
|
69 |
raw_display = raw_display.reset_index(drop=True)
|
70 |
-
|
|
|
71 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
72 |
raw_display['position'] = 'Small Forward'
|
73 |
sf_dem = raw_display[raw_display['Acro'] != ""]
|
@@ -77,7 +80,8 @@ def init_baselines():
|
|
77 |
raw_display.columns = raw_display.iloc[0]
|
78 |
raw_display = raw_display[1:]
|
79 |
raw_display = raw_display.reset_index(drop=True)
|
80 |
-
|
|
|
81 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
82 |
raw_display['position'] = 'Power Forward'
|
83 |
pf_dem = raw_display[raw_display['Acro'] != ""]
|
@@ -87,7 +91,8 @@ def init_baselines():
|
|
87 |
raw_display.columns = raw_display.iloc[0]
|
88 |
raw_display = raw_display[1:]
|
89 |
raw_display = raw_display.reset_index(drop=True)
|
90 |
-
|
|
|
91 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
92 |
raw_display['position'] = 'Center'
|
93 |
c_dem = raw_display[raw_display['Acro'] != ""]
|
|
|
47 |
raw_display.columns = raw_display.iloc[0]
|
48 |
raw_display = raw_display[1:]
|
49 |
raw_display = raw_display.reset_index(drop=True)
|
50 |
+
cols_to_check = ['Pts% Boost', 'Reb% Boost', 'Ast% Boost', '3p% Boost', 'Stl Boost%', 'Blk Boost%', 'TOV Boost%', 'FPPM Boost']
|
51 |
+
raw_display.loc[:, cols_to_check] = raw_display.loc[:, cols_to_check].replace({'%': ''}, regex=True).astype(float) / 100
|
52 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
53 |
raw_display['position'] = 'Point Guard'
|
54 |
pg_dem = raw_display[raw_display['Acro'] != ""]
|
|
|
58 |
raw_display.columns = raw_display.iloc[0]
|
59 |
raw_display = raw_display[1:]
|
60 |
raw_display = raw_display.reset_index(drop=True)
|
61 |
+
cols_to_check = ['Pts% Boost', 'Reb% Boost', 'Ast% Boost', '3p% Boost', 'Stl Boost%', 'Blk Boost%', 'TOV Boost%', 'FPPM Boost']
|
62 |
+
raw_display.loc[:, cols_to_check] = raw_display.loc[:, cols_to_check].replace({'%': ''}, regex=True).astype(float) / 100
|
63 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
64 |
raw_display['position'] = 'Shooting Guard'
|
65 |
sg_dem = raw_display[raw_display['Acro'] != ""]
|
|
|
69 |
raw_display.columns = raw_display.iloc[0]
|
70 |
raw_display = raw_display[1:]
|
71 |
raw_display = raw_display.reset_index(drop=True)
|
72 |
+
cols_to_check = ['Pts% Boost', 'Reb% Boost', 'Ast% Boost', '3p% Boost', 'Stl Boost%', 'Blk Boost%', 'TOV Boost%', 'FPPM Boost']
|
73 |
+
raw_display.loc[:, cols_to_check] = raw_display.loc[:, cols_to_check].replace({'%': ''}, regex=True).astype(float) / 100
|
74 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
75 |
raw_display['position'] = 'Small Forward'
|
76 |
sf_dem = raw_display[raw_display['Acro'] != ""]
|
|
|
80 |
raw_display.columns = raw_display.iloc[0]
|
81 |
raw_display = raw_display[1:]
|
82 |
raw_display = raw_display.reset_index(drop=True)
|
83 |
+
cols_to_check = ['Pts% Boost', 'Reb% Boost', 'Ast% Boost', '3p% Boost', 'Stl Boost%', 'Blk Boost%', 'TOV Boost%', 'FPPM Boost']
|
84 |
+
raw_display.loc[:, cols_to_check] = raw_display.loc[:, cols_to_check].replace({'%': ''}, regex=True).astype(float) / 100
|
85 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
86 |
raw_display['position'] = 'Power Forward'
|
87 |
pf_dem = raw_display[raw_display['Acro'] != ""]
|
|
|
91 |
raw_display.columns = raw_display.iloc[0]
|
92 |
raw_display = raw_display[1:]
|
93 |
raw_display = raw_display.reset_index(drop=True)
|
94 |
+
cols_to_check = ['Pts% Boost', 'Reb% Boost', 'Ast% Boost', '3p% Boost', 'Stl Boost%', 'Blk Boost%', 'TOV Boost%', 'FPPM Boost']
|
95 |
+
raw_display.loc[:, cols_to_check] = raw_display.loc[:, cols_to_check].replace({'%': ''}, regex=True).astype(float) / 100
|
96 |
raw_display = raw_display.apply(pd.to_numeric, errors='coerce').fillna(raw_display)
|
97 |
raw_display['position'] = 'Center'
|
98 |
c_dem = raw_display[raw_display['Acro'] != ""]
|