Skip to main content

NHL dataset loaders — Play-by-play

load_nhl_pbp​

Release: nhl_pbp_full · asset https://github.com/sportsdataverse/sportsdataverse-data/releases/download/nhl_pbp_full/play_by_play_{season}.parquet

Coverage

Shootouts: each attempt is a row with period_type == "SHOOTOUT" (period 5; shootouts are regular season only), a null xg and strength_state "1v0" or "0v1" (a few 2010 and 2020 rows read null or a skater count such as "5v5"); an attempt that scores has event_type == "GOAL", as the NHL API reports it. From season 2015 (2014-15) on, those goals leave home_score / away_score level (in every game since 2021, and in all but at most two a season from 2015 to 2020), and the goal the official final credits the shootout winner is on no row. Earlier, the deciding goal's row often adds that one goal instead: every game in 2011-2013, 120 of 183 in 2010 and 29 of 178 in 2014. Count goals with pl.col("period_type") != "SHOOTOUT" (a penalty shot is also "1v0") and take a shootout game's final score from load_nhl_schedule().

Returns​

col_nametypedescription
event_typeStringNormalized NHL event type: GOAL, SHOT, MISSED_SHOT, BLOCKED_SHOT, FACEOFF, HIT, GIVEAWAY, TAKEAWAY, PENALTY, DELAYED_PENALTY, FAILED_SHOT_ATTEMPT, STOP, PERIOD_START, PERIOD_END, SHOOTOUT_COMPLETE, GAME_END, and CHANGE (shift changes, which load_nhl_pbp_lite drops). A shootout attempt that scores is GOAL with period_type SHOOTOUT; exclude period_type == "SHOOTOUT" to count goals.
eventStringEvent description label.
secondary_typeStringSecondary event type (e.g. shot type).
event_team_abbrStringAbbreviation of the team credited with the event.
event_team_typeStringWhether the event team is home or away.
descriptionStringFull text description of the event.
periodInt64Period number.
period_typeStringREGULAR, OVERTIME or SHOOTOUT. Shootouts are regular season only and are period 5 (a playoff overtime can also reach period 5, as OVERTIME); every shootout row has a null xg, and strength_state is "1v0" or "0v1" (a few 2010 and 2020 rows read null or a skater count such as "5v5").
period_timeStringElapsed time in the period (MM:SS).
period_secondsInt64Elapsed seconds in the period.
period_seconds_remainingInt64Seconds remaining in the period.
period_time_remainingStringTime remaining in the period (MM:SS).
game_secondsInt64Elapsed seconds in the game.
game_seconds_remainingInt64Seconds remaining in regulation.
home_scoreInt64Home goals after the event (a GOAL row includes its own goal). From season 2015 on, shootout goals are not counted, so the score stays level through the shootout and the goal the official final credits the winner is on no row; in earlier seasons the deciding shootout goal often adds it. Take a shootout game's final score from load_nhl_schedule.
away_scoreInt64Away goals after the event (a GOAL row includes its own goal). From season 2015 on, shootout goals are not counted, so the score stays level through the shootout and the goal the official final credits the winner is on no row; in earlier seasons the deciding shootout goal often adds it. Take a shootout game's final score from load_nhl_schedule.
event_player_1_nameStringName of the primary event player.
event_player_1_typeStringRole of the primary event player.
event_player_1_idInt64Player id of the primary event player.
event_player_2_nameStringName of the secondary event player.
event_player_2_typeStringRole of the secondary event player.
event_player_2_idInt64Player id of the secondary event player.
event_player_3_nameStringName of the tertiary event player.
event_player_3_typeStringRole of the tertiary event player.
event_player_3_idInt64Player ID of the tertiary event player.
event_goalie_nameStringName of the goalie on the event.
event_goalie_idInt64Player id of the goalie on the event.
penalty_severityStringSeverity of the penalty.
penalty_minutesInt64Penalty minutes.
strength_stateStringStrength state (e.g. 5v5, 5v4).
strength_codeStringStrength state code (e.g., all, even, pp, pk).
strengthStringStrength label (Even, Power Play, Shorthanded).
empty_netBooleanWhether the net was empty.
extra_attackerBooleanWhether an extra attacker was on the ice.
xInt64Raw x-coordinate of the event.
yInt64Raw y-coordinate of the event.
x_fixedInt64Normalized x coordinate (home shoots right).
y_fixedInt64Normalized y coordinate (home shoots right).
shot_distanceFloat64Distance of the shot from the net.
shot_angleFloat64Angle of the shot relative to the net.
home_skatersInt64Number of home skaters on the ice.
away_skatersInt64Number of away skaters on the ice.
home_on_1StringName of home skater 1 on the ice.
home_on_2StringName of home skater 2 on the ice.
home_on_3StringName of home skater 3 on the ice.
home_on_4StringName of home skater 4 on the ice.
home_on_5StringName of home skater 5 on the ice.
home_on_6StringName of home skater 6 on the ice.
home_on_7StringName of home skater 7 on the ice.
away_on_1StringName of away skater 1 on the ice.
away_on_2StringName of away skater 2 on the ice.
away_on_3StringName of away skater 3 on the ice.
away_on_4StringName of away skater 4 on the ice.
away_on_5StringName of away skater 5 on the ice.
away_on_6StringName of away skater 6 on the ice.
away_on_7StringName of away skater 7 on the ice.
home_goalieStringName of the home goalie on the ice.
away_goalieStringName of the away goalie on the ice.
num_onInt64Number of players coming on (line change).
players_onStringNames of players coming on.
num_offInt64Number of players going off (line change).
players_offStringNames of players going off.
game_idInt64Unique game identifier.
seasonStringSeason year (echoed from arg).
season_typeStringSeason type code (echoed from arg).
home_abbrStringHome team abbreviation.
away_abbrStringAway team abbreviation.
event_idxInt64Sequential event index within the game.
event_idInt64ESPN event id (echoed from arg).
pptReplayUrlStringURL to the play replay, if available.
away_goalie_inInt64Whether the away goalie is on the ice (1/0).
home_goalie_inInt64Whether the home goalie is on the ice (1/0).
reasonStringReason for the event (e.g. stoppage reason).
secondaryReasonStringSecondary reason for a stoppage.
ids_onStringPlayer ids coming on.
ids_offStringPlayer ids going off.
home_on_1_idInt64Player id of home skater 1 on the ice.
away_on_1_idInt64Player id of away skater 1 on the ice.
home_on_2_idInt64Player id of home skater 2 on the ice.
away_on_2_idInt64Player id of away skater 2 on the ice.
home_on_3_idInt64Player id of home skater 3 on the ice.
away_on_3_idInt64Player id of away skater 3 on the ice.
home_on_4_idInt64Player id of home skater 4 on the ice.
away_on_4_idInt64Player id of away skater 4 on the ice.
home_on_5_idInt64Player id of home skater 5 on the ice.
away_on_5_idInt64Player id of away skater 5 on the ice.
home_on_6_idInt64Player id of home skater 6 on the ice.
away_on_6_idInt64Player id of away skater 6 on the ice.
home_on_7_idInt64Player id of home skater 7 on the ice.
away_on_7_idInt64Player id of away skater 7 on the ice.
home_goalie_idInt64Player ID of the home goalie on the ice.
away_goalie_idInt64Player ID of the away goalie on the ice.
xgFloat64Expected goals value for the shot event.
game_dateStringGame date.
load_nhl_pbp(seasons=2024)

load_nhl_pbp_full​

Release: nhl_pbp_full · asset https://github.com/sportsdataverse/sportsdataverse-data/releases/download/nhl_pbp_full/play_by_play_{season}.parquet

Coverage

Shootouts: each attempt is a row with period_type == "SHOOTOUT" (period 5; shootouts are regular season only), a null xg and strength_state "1v0" or "0v1" (a few 2010 and 2020 rows read null or a skater count such as "5v5"); an attempt that scores has event_type == "GOAL", as the NHL API reports it. From season 2015 (2014-15) on, those goals leave home_score / away_score level (in every game since 2021, and in all but at most two a season from 2015 to 2020), and the goal the official final credits the shootout winner is on no row. Earlier, the deciding goal's row often adds that one goal instead: every game in 2011-2013, 120 of 183 in 2010 and 29 of 178 in 2014. Count goals with pl.col("period_type") != "SHOOTOUT" (a penalty shot is also "1v0") and take a shootout game's final score from load_nhl_schedule().

Returns​

col_nametypedescription
event_typeStringNormalized NHL event type: GOAL, SHOT, MISSED_SHOT, BLOCKED_SHOT, FACEOFF, HIT, GIVEAWAY, TAKEAWAY, PENALTY, DELAYED_PENALTY, FAILED_SHOT_ATTEMPT, STOP, PERIOD_START, PERIOD_END, SHOOTOUT_COMPLETE, GAME_END, and CHANGE (shift changes, which load_nhl_pbp_lite drops). A shootout attempt that scores is GOAL with period_type SHOOTOUT; exclude period_type == "SHOOTOUT" to count goals.
eventStringEvent description label.
secondary_typeStringSecondary event type (e.g. shot type).
event_team_abbrStringAbbreviation of the team credited with the event.
event_team_typeStringWhether the event team is home or away.
descriptionStringFull text description of the event.
periodInt64Period number.
period_typeStringREGULAR, OVERTIME or SHOOTOUT. Shootouts are regular season only and are period 5 (a playoff overtime can also reach period 5, as OVERTIME); every shootout row has a null xg, and strength_state is "1v0" or "0v1" (a few 2010 and 2020 rows read null or a skater count such as "5v5").
period_timeStringElapsed time in the period (MM:SS).
period_secondsInt64Elapsed seconds in the period.
period_seconds_remainingInt64Seconds remaining in the period.
period_time_remainingStringTime remaining in the period (MM:SS).
game_secondsInt64Elapsed seconds in the game.
game_seconds_remainingInt64Seconds remaining in regulation.
home_scoreInt64Home goals after the event (a GOAL row includes its own goal). From season 2015 on, shootout goals are not counted, so the score stays level through the shootout and the goal the official final credits the winner is on no row; in earlier seasons the deciding shootout goal often adds it. Take a shootout game's final score from load_nhl_schedule.
away_scoreInt64Away goals after the event (a GOAL row includes its own goal). From season 2015 on, shootout goals are not counted, so the score stays level through the shootout and the goal the official final credits the winner is on no row; in earlier seasons the deciding shootout goal often adds it. Take a shootout game's final score from load_nhl_schedule.
event_player_1_nameStringName of the primary event player.
event_player_1_typeStringRole of the primary event player.
event_player_1_idInt64Player id of the primary event player.
event_player_2_nameStringName of the secondary event player.
event_player_2_typeStringRole of the secondary event player.
event_player_2_idInt64Player id of the secondary event player.
event_player_3_nameStringName of the tertiary event player.
event_player_3_typeStringRole of the tertiary event player.
event_player_3_idInt64Player ID of the tertiary event player.
event_goalie_nameStringName of the goalie on the event.
event_goalie_idInt64Player id of the goalie on the event.
penalty_severityStringSeverity of the penalty.
penalty_minutesInt64Penalty minutes.
strength_stateStringStrength state (e.g. 5v5, 5v4).
strength_codeStringStrength state code (e.g., all, even, pp, pk).
strengthStringStrength label (Even, Power Play, Shorthanded).
empty_netBooleanWhether the net was empty.
extra_attackerBooleanWhether an extra attacker was on the ice.
xInt64Raw x-coordinate of the event.
yInt64Raw y-coordinate of the event.
x_fixedInt64Normalized x coordinate (home shoots right).
y_fixedInt64Normalized y coordinate (home shoots right).
shot_distanceFloat64Distance of the shot from the net.
shot_angleFloat64Angle of the shot relative to the net.
home_skatersInt64Number of home skaters on the ice.
away_skatersInt64Number of away skaters on the ice.
home_on_1StringName of home skater 1 on the ice.
home_on_2StringName of home skater 2 on the ice.
home_on_3StringName of home skater 3 on the ice.
home_on_4StringName of home skater 4 on the ice.
home_on_5StringName of home skater 5 on the ice.
home_on_6StringName of home skater 6 on the ice.
home_on_7StringName of home skater 7 on the ice.
away_on_1StringName of away skater 1 on the ice.
away_on_2StringName of away skater 2 on the ice.
away_on_3StringName of away skater 3 on the ice.
away_on_4StringName of away skater 4 on the ice.
away_on_5StringName of away skater 5 on the ice.
away_on_6StringName of away skater 6 on the ice.
away_on_7StringName of away skater 7 on the ice.
home_goalieStringName of the home goalie on the ice.
away_goalieStringName of the away goalie on the ice.
num_onInt64Number of players coming on (line change).
players_onStringNames of players coming on.
num_offInt64Number of players going off (line change).
players_offStringNames of players going off.
game_idInt64Unique game identifier.
seasonStringSeason year (echoed from arg).
season_typeStringSeason type code (echoed from arg).
home_abbrStringHome team abbreviation.
away_abbrStringAway team abbreviation.
event_idxInt64Sequential event index within the game.
event_idInt64ESPN event id (echoed from arg).
pptReplayUrlStringURL to the play replay, if available.
away_goalie_inInt64Whether the away goalie is on the ice (1/0).
home_goalie_inInt64Whether the home goalie is on the ice (1/0).
reasonStringReason for the event (e.g. stoppage reason).
secondaryReasonStringSecondary reason for a stoppage.
ids_onStringPlayer ids coming on.
ids_offStringPlayer ids going off.
home_on_1_idInt64Player id of home skater 1 on the ice.
away_on_1_idInt64Player id of away skater 1 on the ice.
home_on_2_idInt64Player id of home skater 2 on the ice.
away_on_2_idInt64Player id of away skater 2 on the ice.
home_on_3_idInt64Player id of home skater 3 on the ice.
away_on_3_idInt64Player id of away skater 3 on the ice.
home_on_4_idInt64Player id of home skater 4 on the ice.
away_on_4_idInt64Player id of away skater 4 on the ice.
home_on_5_idInt64Player id of home skater 5 on the ice.
away_on_5_idInt64Player id of away skater 5 on the ice.
home_on_6_idInt64Player id of home skater 6 on the ice.
away_on_6_idInt64Player id of away skater 6 on the ice.
home_on_7_idInt64Player id of home skater 7 on the ice.
away_on_7_idInt64Player id of away skater 7 on the ice.
home_goalie_idInt64Player ID of the home goalie on the ice.
away_goalie_idInt64Player ID of the away goalie on the ice.
xgFloat64Expected goals value for the shot event.
game_dateStringGame date.
load_nhl_pbp_full(seasons=2010)

load_nhl_pbp_lite​

Release: nhl_pbp_lite · asset https://github.com/sportsdataverse/sportsdataverse-data/releases/download/nhl_pbp_lite/play_by_play_lite_{season}.parquet

Coverage

Shootouts: each attempt is a row with period_type == "SHOOTOUT" (period 5; shootouts are regular season only), a null xg and strength_state "1v0" or "0v1" (a few 2010 and 2020 rows read null or a skater count such as "5v5"); an attempt that scores has event_type == "GOAL", as the NHL API reports it. From season 2015 (2014-15) on, those goals leave home_score / away_score level (in every game since 2021, and in all but at most two a season from 2015 to 2020), and the goal the official final credits the shootout winner is on no row. Earlier, the deciding goal's row often adds that one goal instead: every game in 2011-2013, 120 of 183 in 2010 and 29 of 178 in 2014. Count goals with pl.col("period_type") != "SHOOTOUT" (a penalty shot is also "1v0") and take a shootout game's final score from load_nhl_schedule().

Returns​

col_nametypedescription
event_typeStringNormalized NHL event type: GOAL, SHOT, MISSED_SHOT, BLOCKED_SHOT, FACEOFF, HIT, GIVEAWAY, TAKEAWAY, PENALTY, DELAYED_PENALTY, FAILED_SHOT_ATTEMPT, STOP, PERIOD_START, PERIOD_END, SHOOTOUT_COMPLETE, GAME_END (the lite release drops the CHANGE shift rows that load_nhl_pbp_full carries). A shootout attempt that scores is GOAL with period_type SHOOTOUT; exclude period_type == "SHOOTOUT" to count goals.
eventStringEvent description label.
secondary_typeStringSecondary event type (e.g. shot type).
event_team_abbrStringAbbreviation of the team credited with the event.
event_team_typeStringWhether the event team is home or away.
descriptionStringFull text description of the event.
periodInt32Period number.
period_typeStringREGULAR, OVERTIME or SHOOTOUT. Shootouts are regular season only and are period 5 (a playoff overtime can also reach period 5, as OVERTIME); every shootout row has a null xg, and strength_state is "1v0" or "0v1" (a few 2010 and 2020 rows read null or a skater count such as "5v5").
period_timeStringElapsed time in the period (MM:SS).
period_secondsInt32Elapsed seconds in the period.
period_seconds_remainingInt32Seconds remaining in the period.
period_time_remainingStringTime remaining in the period (MM:SS).
game_secondsInt32Elapsed seconds in the game.
game_seconds_remainingInt32Seconds remaining in regulation.
home_scoreInt32Home goals after the event (a GOAL row includes its own goal). From season 2015 on, shootout goals are not counted, so the score stays level through the shootout and the goal the official final credits the winner is on no row; in earlier seasons the deciding shootout goal often adds it. Take a shootout game's final score from load_nhl_schedule.
away_scoreInt32Away goals after the event (a GOAL row includes its own goal). From season 2015 on, shootout goals are not counted, so the score stays level through the shootout and the goal the official final credits the winner is on no row; in earlier seasons the deciding shootout goal often adds it. Take a shootout game's final score from load_nhl_schedule.
event_player_1_nameStringName of the primary event player.
event_player_1_typeStringRole of the primary event player.
event_player_1_idInt32Player id of the primary event player.
event_player_2_nameStringName of the secondary event player.
event_player_2_typeStringRole of the secondary event player.
event_player_2_idInt32Player id of the secondary event player.
event_player_3_nameStringName of the tertiary event player.
event_player_3_typeStringRole of the tertiary event player.
event_player_3_idInt32Player ID of the tertiary event player.
event_goalie_nameStringName of the goalie on the event.
event_goalie_idInt32Player id of the goalie on the event.
penalty_severityStringSeverity of the penalty.
penalty_minutesInt32Penalty minutes.
strength_stateStringStrength state (e.g. 5v5, 5v4).
strength_codeStringStrength state code (e.g., all, even, pp, pk).
strengthStringStrength label (Even, Power Play, Shorthanded).
empty_netBooleanWhether the net was empty.
extra_attackerBooleanWhether an extra attacker was on the ice.
xInt32Raw x-coordinate of the event.
yInt32Raw y-coordinate of the event.
x_fixedInt32Normalized x coordinate (home shoots right).
y_fixedInt32Normalized y coordinate (home shoots right).
shot_distanceFloat64Distance of the shot from the net.
shot_angleFloat64Angle of the shot relative to the net.
home_skatersInt32Number of home skaters on the ice.
away_skatersInt32Number of away skaters on the ice.
home_on_1StringName of home skater 1 on the ice.
home_on_2StringName of home skater 2 on the ice.
home_on_3StringName of home skater 3 on the ice.
home_on_4StringName of home skater 4 on the ice.
home_on_5StringName of home skater 5 on the ice.
home_on_6StringName of home skater 6 on the ice.
home_on_7StringName of home skater 7 on the ice.
away_on_1StringName of away skater 1 on the ice.
away_on_2StringName of away skater 2 on the ice.
away_on_3StringName of away skater 3 on the ice.
away_on_4StringName of away skater 4 on the ice.
away_on_5StringName of away skater 5 on the ice.
away_on_6StringName of away skater 6 on the ice.
away_on_7StringName of away skater 7 on the ice.
home_goalieStringName of the home goalie on the ice.
away_goalieStringName of the away goalie on the ice.
num_onInt32Number of players coming on (line change).
players_onStringNames of players coming on.
num_offInt32Number of players going off (line change).
players_offStringNames of players going off.
game_idInt32Unique game identifier.
seasonInt32Season year (echoed from arg).
season_typeStringSeason type code (echoed from arg).
home_abbrStringHome team abbreviation.
away_abbrStringAway team abbreviation.
event_idxInt32Sequential event index within the game.
event_idInt32ESPN event id (echoed from arg).
pptReplayUrlStringURL to the play replay, if available.
away_goalie_inInt32Whether the away goalie is on the ice (1/0).
home_goalie_inInt32Whether the home goalie is on the ice (1/0).
reasonStringReason for the event (e.g. stoppage reason).
secondaryReasonStringSecondary reason for a stoppage.
ids_onStringPlayer ids coming on.
ids_offStringPlayer ids going off.
home_on_1_idInt32Player id of home skater 1 on the ice.
away_on_1_idInt32Player id of away skater 1 on the ice.
home_on_2_idInt32Player id of home skater 2 on the ice.
away_on_2_idInt32Player id of away skater 2 on the ice.
home_on_3_idInt32Player id of home skater 3 on the ice.
away_on_3_idInt32Player id of away skater 3 on the ice.
home_on_4_idInt32Player id of home skater 4 on the ice.
away_on_4_idInt32Player id of away skater 4 on the ice.
home_on_5_idInt32Player id of home skater 5 on the ice.
away_on_5_idInt32Player id of away skater 5 on the ice.
home_on_6_idInt32Player id of home skater 6 on the ice.
away_on_6_idInt32Player id of away skater 6 on the ice.
home_on_7_idInt32Player id of home skater 7 on the ice.
away_on_7_idInt32Player id of away skater 7 on the ice.
home_goalie_idInt32Player ID of the home goalie on the ice.
away_goalie_idInt32Player ID of the away goalie on the ice.
xgFloat64Expected goals value for the shot event.
load_nhl_pbp_lite(seasons=2010)