pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

team_ids method not returning any data for certain years

Open brekker23 opened this issue 3 months ago • 1 comments

the team_ids method is returning an empty pandas dataframe, the .info() call on the data frame shows that it has the proper columns and datatypes but there is no data. I tested it with the years 2023, 2024, 2025 and none of them worked but every other year I tested did.

brekker23 avatar Sep 02 '25 21:09 brekker23

+1, the CSV (sideloaded in the package) has data only up to 2021. Why is this not generated from a network call and then cached?

EDIT: Assuming this is built from Retrosheet it seems to mirror the data here: https://www.retrosheet.org/TeamIDs.htm Interestingly, the Retrosheet ground truth also appears to stop at 2021. The corresponding nicknames file at https://www.retrosheet.org/Nickname.htm has start dates and end dates for team names and have blank end dates for some teams- presumably those still using that name. Based on how none of the rows here have an end date in 2021, a workaround seems to be just to query for 2021 and assume it is the same for all following years.

longoodr avatar Sep 07 '25 03:09 longoodr