pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

get_splits() throwing unexpected error

Open GiuseppePapalia opened this issue 2 years ago • 2 comments

This happens for quite a few players and it happens over every year

Executing: get_splits("kershcl01", 2015)

Throws:

IndexError: single positional indexer is out-of-bounds
at pybaseball\split_stats.py", line 128, in get_splits
    data = data.rename(columns=data.iloc[0])

GiuseppePapalia avatar Jun 14 '23 20:06 GiuseppePapalia

I just ran into this issue and may have figured out a possible solution. I got this same error when running Python 3.11, but creating a venv running Python 3.10 seems to have resolved it.

I tested a few other functions when I was running 3.11 and didn't run into any issues. So this error might be isolated to the get_splits() function.

eleven413 avatar Jun 03 '25 20:06 eleven413

Is there any solution to this issue without having to change the python version? I'm currently using 3.13 and would like to use get_splits() without changing versions.

NathanKim16 avatar Jul 12 '25 21:07 NathanKim16