jldbc / pybaseball

Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.18k stars 322 forks source link

playerid_reverse_lookup throwing ValueError #337

Closed agad495 closed 1 year ago

agad495 commented 1 year ago

Passing a list of player id's from statcast data is returning the following error:

ValueError: Usecols do not match columns, columns expected but not found: ['key_bbref', 'mlb_played_first', 'name_last', 'mlb_played_last', 'key_retro', 'key_fangraphs', 'name_first', 'key_mlbam']

The function call looks like this:

id_list = [666179, 608348, 656976, 572233, 663757, 673490, 595777, 543333, 444482, 606466] player_ids = playerid_reverse_lookup(id_list)

I have tried with key_type='mlbam' and without a key_type specified.

Is there something wrong with how I'm using the function or is there a problem with the function itself? Please feel free to let me know if there is any other info I can provide to help figure out what's going on. Thanks!

tjburch commented 1 year ago

Update the package, pip install pybaseball -U. See #333, #326, #308.