Closed TobiasCortese closed 1 year ago
I am also experiencing the same issue.
Agreed, same issue arises for me. Any ideas on alternative way to receive player key_mlbam?
@DannyPhant8m - I'm pulling key_mlbam from the statcast (batter/pitcher) and baseball reference (mlbID) data
@DannyPhant8m - I'm pulling key_mlbam from the statcast (batter/pitcher) and baseball reference (mlbID) data
The statcast function provides both batter and pitcher key_mlbam, but the player_name column only tells you the pitcher. How do you know which batter correlates to the batter key_mlbam?
getting the same error with the chadwick_register. guessing it's all related.
from pybaseball import chadwick_register --get the register data and save to disk chadwick_data = chadwick_register(save=True)
https://github.com/chadwickbureau/register
It seems that reference file is seperated. people.csv, referenced by chadwick_register(), was split into 16 files, people-[0-f].csv .
https://github.com/chadwickbureau/register
It seems that reference file is seperated. people.csv, referenced by chadwick_register(), was split into 16 files, people-[0-f].csv .
Exactly that. The PyBaseball team will need time to reflect changes in their function more than likely. Until then you'll need to write your own to reflect the change that's been made upstream from chadwickbureau.
@DannyPhant8m - I'm pulling key_mlbam from the statcast (batter/pitcher) and baseball reference (mlbID) data
The statcast function provides both batter and pitcher key_mlbam, but the player_name column only tells you the pitcher. How do you know which batter correlates to the batter key_mlbam?
@DannyPhant8m - I'm pulling key_mlbam from the statcast (batter/pitcher) and baseball reference (mlbID) data
The statcast function provides both batter and pitcher key_mlbam, but the player_name column only tells you the pitcher. How do you know which batter correlates to the batter key_mlbam?
@DannyPhant8m - I'm using bwar_pitch() to hack a join table
I've worked up a temporary fix that is working for me. Simply adjust the _playerlookup.py file in the pybaseball folder as follows:
1. Change url on line 12 to:
2. Change lines 30-33 to:
Confirming this works after #309:
>>> data = playerid_reverse_lookup(player_ids, key_type='mlbam')
>>> data
name_last name_first key_mlbam key_retro key_bbref key_fangraphs mlb_played_first mlb_played_last
0 jeter shawn 116541 jetes001 jetersh01 1006406 1992.0 1992.0
1 jeter derek 116539 jeted001 jeterde01 826 1995.0 2014.0
2 jeter johnny 116540 jetej101 jeterjo01 1006405 1969.0 1974.0
The forward lookup throws a bunch of warnings now but I'll open a new issue for that.
@tjburch, your above comment still does not work for me at the moment
There hasn't been a new release yet so it's not on PyPi. Install the library directly from git, not pip.
playerid_lookup() and playerid_reverse_lookup() are both generating the error in the title. both functions operated as expected yesterday.
wondering if anyone else is experiencing these issues?
simply executed the sample code to create the errors. specifically the following...