Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,8 +64,10 @@ def player_bio(pitcher_id: str, ax: plt.Axes, sport_id: int, year_input: int):
|
|
| 64 |
response = requests.get(url='https://statsapi.mlb.com/api/v1/sports').json()
|
| 65 |
|
| 66 |
# Convert the JSON response into a Polars DataFrame
|
| 67 |
-
df_sport_id = pl.DataFrame(response['sports'])
|
| 68 |
-
abb = df_sport_id.filter(pl.col('id') == sport_id)['abbreviation'][0]
|
|
|
|
|
|
|
| 69 |
|
| 70 |
# Display the season and sport abbreviation
|
| 71 |
ax.text(0.5, 0.20, f'{year_input} {abb} Season', va='top', ha='center', fontsize=14, fontstyle='italic')
|
|
|
|
| 64 |
response = requests.get(url='https://statsapi.mlb.com/api/v1/sports').json()
|
| 65 |
|
| 66 |
# Convert the JSON response into a Polars DataFrame
|
| 67 |
+
#df_sport_id = pl.DataFrame(response['sports'])
|
| 68 |
+
#abb = df_sport_id.filter(pl.col('id') == sport_id)['abbreviation'][0]
|
| 69 |
+
|
| 70 |
+
abb = level_dict[str(sport_id)]
|
| 71 |
|
| 72 |
# Display the season and sport abbreviation
|
| 73 |
ax.text(0.5, 0.20, f'{year_input} {abb} Season', va='top', ha='center', fontsize=14, fontstyle='italic')
|