pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

playerid_reverse_lookup does not return 2023 rookies when using fangraphs key type

Open sam-walsh opened this issue 2 years ago • 2 comments

This is my process

# returns 2023 season stats (dataframe includes the rookies when inspected)
fg = pb.fg_batting_data(2023, qual=0) 

# create lookup table for all players in 2023
lookup = pb.playerid_reverse_lookup(fg['IDfg'], key_type='fangraphs')

# sort values by descending mlbam keys to show most recently called up players
lookup.sort_values(by=['key_mlbam'], ascending=False) 

image As shown in the image the players at the top are those who were called up late in the 2022 season. No 2023 debuting players are in the lookup table. I am using pybaseball version 2.2.5

sam-walsh avatar May 16 '23 20:05 sam-walsh

Hi @sam-walsh it appears that this issue has been resolved, as players with 2023 debut now show up in the output of your code.

image

AndrewsOR avatar Nov 30 '23 13:11 AndrewsOR