Spaces:
Running
Running
James McCool
commited on
Commit
·
90d5e18
1
Parent(s):
05e02d5
Update 'Order' and 'Hand' column handling in app.py to replace NaN with 0 for 'Order' and default 'Hand' to 'Pitcher' for improved data consistency and clarity in player data processing for hitters.
Browse files
app.py
CHANGED
@@ -78,12 +78,11 @@ def init_baselines():
|
|
78 |
roo_data['Salary'] = roo_data['Salary'].astype(int)
|
79 |
hold_frame = roo_data.copy()
|
80 |
|
81 |
-
hold_frame['Order'] = np.where(hold_frame['pos_group'] == 'Hitters', hold_frame['Player'].map(RHP_Info.set_index('Player')['Order']),
|
82 |
-
hold_frame['Hand'] = np.where(hold_frame['pos_group'] == 'Hitters', hold_frame['Player'].map(RHP_Info.set_index('Player')['bats']), '')
|
83 |
|
84 |
roo_data.insert(3, 'Hand', hold_frame['Hand'])
|
85 |
roo_data.insert(4, 'Order', hold_frame['Order'].astype(int))
|
86 |
-
roo_data['Order'] = roo_data['Order'].fillna('')
|
87 |
|
88 |
dk_roo = roo_data[roo_data['Site'] == 'Draftkings']
|
89 |
dk_id_map = dict(zip(dk_roo['Player'], dk_roo['player_ID']))
|
|
|
78 |
roo_data['Salary'] = roo_data['Salary'].astype(int)
|
79 |
hold_frame = roo_data.copy()
|
80 |
|
81 |
+
hold_frame['Order'] = np.where(hold_frame['pos_group'] == 'Hitters', hold_frame['Player'].map(RHP_Info.set_index('Player')['Order']), 0)
|
82 |
+
hold_frame['Hand'] = np.where(hold_frame['pos_group'] == 'Hitters', hold_frame['Player'].map(RHP_Info.set_index('Player')['bats']), 'Pitcher')
|
83 |
|
84 |
roo_data.insert(3, 'Hand', hold_frame['Hand'])
|
85 |
roo_data.insert(4, 'Order', hold_frame['Order'].astype(int))
|
|
|
86 |
|
87 |
dk_roo = roo_data[roo_data['Site'] == 'Draftkings']
|
88 |
dk_id_map = dict(zip(dk_roo['Player'], dk_roo['player_ID']))
|