Skip to content

Commit

Permalink
Fix pbp and pbp participation join issue (#79)
Browse files Browse the repository at this point in the history
Resolves issue with play_by_play data having incorrect old_game_id values. For example, all old_game_id values in the play_by_play_2023 for week 15 start with "2022" but they begin with "2023" in the pbp_participation_2023 data.
  • Loading branch information
RGAlexander216 authored Sep 16, 2024
1 parent 1df0931 commit c988631
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nfl_data_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ def import_pbp_data(
if all([include_participation, year >= 2016, not cache]):
path = r'https://github.com/nflverse/nflverse-data/releases/download/pbp_participation/pbp_participation_{}.parquet'.format(year)
partic = pandas.read_parquet(path)
raw = raw.merge(partic, how='left', on=['play_id','old_game_id'])
raw = raw.merge(partic,
how='left',
left_on=['play_id','game_id'],
right_on=['play_id','nflverse_game_id'])

pbp_data.append(raw)
print(str(year) + ' done.')
Expand Down

0 comments on commit c988631

Please sign in to comment.