Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,11 +26,13 @@ print(teams)
|
|
| 26 |
|
| 27 |
df_player = pl.concat([
|
| 28 |
scraper.get_players(sport_id=1,season=2025,game_type=['R']),
|
|
|
|
|
|
|
| 29 |
scraper.get_players(sport_id=11,season=2025,game_type=['R']),
|
| 30 |
scraper.get_players(sport_id=12,season=2025,game_type=['R']),
|
| 31 |
scraper.get_players(sport_id=13,season=2025,game_type=['R']),
|
| 32 |
scraper.get_players(sport_id=14,season=2025,game_type=['R']),
|
| 33 |
-
scraper.get_players(sport_id=22,season=
|
| 34 |
]).unique(subset=['player_id'])
|
| 35 |
|
| 36 |
|
|
@@ -126,9 +128,9 @@ def server(input, output, session):
|
|
| 126 |
df_output['bat_throw'] = df_output['batSide'] + '/' + df_output['pitchHand']
|
| 127 |
df_output_small = df_output[['position_group','person.id', 'person.fullName',
|
| 128 |
'position.abbreviation','team', 'status.code', 'age','weight', 'height', 'bat_throw']]
|
| 129 |
-
df_output_small['age'] = df_output_small['age'].replace('', np.nan).astype(
|
| 130 |
-
df_output_small['weight'] = df_output_small['weight'].replace('', np.nan).astype(
|
| 131 |
-
|
| 132 |
# # Insert blank rows with position group indicated
|
| 133 |
# blank_rows = []
|
| 134 |
# for idx, row in df_output_small.iterrows():
|
|
|
|
| 26 |
|
| 27 |
df_player = pl.concat([
|
| 28 |
scraper.get_players(sport_id=1,season=2025,game_type=['R']),
|
| 29 |
+
scraper.get_players(sport_id=1,season=2024,game_type=['R']),
|
| 30 |
+
scraper.get_players(sport_id=1,season=2023,game_type=['R']),
|
| 31 |
scraper.get_players(sport_id=11,season=2025,game_type=['R']),
|
| 32 |
scraper.get_players(sport_id=12,season=2025,game_type=['R']),
|
| 33 |
scraper.get_players(sport_id=13,season=2025,game_type=['R']),
|
| 34 |
scraper.get_players(sport_id=14,season=2025,game_type=['R']),
|
| 35 |
+
scraper.get_players(sport_id=22,season=2024,game_type=['R'])
|
| 36 |
]).unique(subset=['player_id'])
|
| 37 |
|
| 38 |
|
|
|
|
| 128 |
df_output['bat_throw'] = df_output['batSide'] + '/' + df_output['pitchHand']
|
| 129 |
df_output_small = df_output[['position_group','person.id', 'person.fullName',
|
| 130 |
'position.abbreviation','team', 'status.code', 'age','weight', 'height', 'bat_throw']]
|
| 131 |
+
df_output_small['age'] = df_output_small['age'].replace('', np.nan).astype('Int64')
|
| 132 |
+
df_output_small['weight'] = df_output_small['weight'].replace('', np.nan).astype('Int64')
|
| 133 |
+
|
| 134 |
# # Insert blank rows with position group indicated
|
| 135 |
# blank_rows = []
|
| 136 |
# for idx, row in df_output_small.iterrows():
|