pybaseball
pybaseball copied to clipboard
get_splits() throwing unexpected error
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])
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.
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.