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
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_name | type | description |
|---|---|---|
event_type | String | Normalized 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. |
event | String | Event description label. |
secondary_type | String | Secondary event type (e.g. shot type). |
event_team_abbr | String | Abbreviation of the team credited with the event. |
event_team_type | String | Whether the event team is home or away. |
description | String | Full text description of the event. |
period | Int64 | Period number. |
period_type | String | REGULAR, 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_time | String | Elapsed time in the period (MM:SS). |
period_seconds | Int64 | Elapsed seconds in the period. |
period_seconds_remaining | Int64 | Seconds remaining in the period. |
period_time_remaining | String | Time remaining in the period (MM:SS). |
game_seconds | Int64 | Elapsed seconds in the game. |
game_seconds_remaining | Int64 | Seconds remaining in regulation. |
home_score | Int64 | Home 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_score | Int64 | Away 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_name | String | Name of the primary event player. |
event_player_1_type | String | Role of the primary event player. |
event_player_1_id | Int64 | Player id of the primary event player. |
event_player_2_name | String | Name of the secondary event player. |
event_player_2_type | String | Role of the secondary event player. |
event_player_2_id | Int64 | Player id of the secondary event player. |
event_player_3_name | String | Name of the tertiary event player. |
event_player_3_type | String | Role of the tertiary event player. |
event_player_3_id | Int64 | Player ID of the tertiary event player. |
event_goalie_name | String | Name of the goalie on the event. |
event_goalie_id | Int64 | Player id of the goalie on the event. |
penalty_severity | String | Severity of the penalty. |
penalty_minutes | Int64 | Penalty minutes. |
strength_state | String | Strength state (e.g. 5v5, 5v4). |
strength_code | String | Strength state code (e.g., all, even, pp, pk). |
strength | String | Strength label (Even, Power Play, Shorthanded). |
empty_net | Boolean | Whether the net was empty. |
extra_attacker | Boolean | Whether an extra attacker was on the ice. |
x | Int64 | Raw x-coordinate of the event. |
y | Int64 | Raw y-coordinate of the event. |
x_fixed | Int64 | Normalized x coordinate (home shoots right). |
y_fixed | Int64 | Normalized y coordinate (home shoots right). |
shot_distance | Float64 | Distance of the shot from the net. |
shot_angle | Float64 | Angle of the shot relative to the net. |
home_skaters | Int64 | Number of home skaters on the ice. |
away_skaters | Int64 | Number of away skaters on the ice. |
home_on_1 | String | Name of home skater 1 on the ice. |
home_on_2 | String | Name of home skater 2 on the ice. |
home_on_3 | String | Name of home skater 3 on the ice. |
home_on_4 | String | Name of home skater 4 on the ice. |
home_on_5 | String | Name of home skater 5 on the ice. |
home_on_6 | String | Name of home skater 6 on the ice. |
home_on_7 | String | Name of home skater 7 on the ice. |
away_on_1 | String | Name of away skater 1 on the ice. |
away_on_2 | String | Name of away skater 2 on the ice. |
away_on_3 | String | Name of away skater 3 on the ice. |
away_on_4 | String | Name of away skater 4 on the ice. |
away_on_5 | String | Name of away skater 5 on the ice. |
away_on_6 | String | Name of away skater 6 on the ice. |
away_on_7 | String | Name of away skater 7 on the ice. |
home_goalie | String | Name of the home goalie on the ice. |
away_goalie | String | Name of the away goalie on the ice. |
num_on | Int64 | Number of players coming on (line change). |
players_on | String | Names of players coming on. |
num_off | Int64 | Number of players going off (line change). |
players_off | String | Names of players going off. |
game_id | Int64 | Unique game identifier. |
season | String | Season year (echoed from arg). |
season_type | String | Season type code (echoed from arg). |
home_abbr | String | Home team abbreviation. |
away_abbr | String | Away team abbreviation. |
event_idx | Int64 | Sequential event index within the game. |
event_id | Int64 | ESPN event id (echoed from arg). |
pptReplayUrl | String | URL to the play replay, if available. |
away_goalie_in | Int64 | Whether the away goalie is on the ice (1/0). |
home_goalie_in | Int64 | Whether the home goalie is on the ice (1/0). |
reason | String | Reason for the event (e.g. stoppage reason). |
secondaryReason | String | Secondary reason for a stoppage. |
ids_on | String | Player ids coming on. |
ids_off | String | Player ids going off. |
home_on_1_id | Int64 | Player id of home skater 1 on the ice. |
away_on_1_id | Int64 | Player id of away skater 1 on the ice. |
home_on_2_id | Int64 | Player id of home skater 2 on the ice. |
away_on_2_id | Int64 | Player id of away skater 2 on the ice. |
home_on_3_id | Int64 | Player id of home skater 3 on the ice. |
away_on_3_id | Int64 | Player id of away skater 3 on the ice. |
home_on_4_id | Int64 | Player id of home skater 4 on the ice. |
away_on_4_id | Int64 | Player id of away skater 4 on the ice. |
home_on_5_id | Int64 | Player id of home skater 5 on the ice. |
away_on_5_id | Int64 | Player id of away skater 5 on the ice. |
home_on_6_id | Int64 | Player id of home skater 6 on the ice. |
away_on_6_id | Int64 | Player id of away skater 6 on the ice. |
home_on_7_id | Int64 | Player id of home skater 7 on the ice. |
away_on_7_id | Int64 | Player id of away skater 7 on the ice. |
home_goalie_id | Int64 | Player ID of the home goalie on the ice. |
away_goalie_id | Int64 | Player ID of the away goalie on the ice. |
xg | Float64 | Expected goals value for the shot event. |
game_date | String | Game 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
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_name | type | description |
|---|---|---|
event_type | String | Normalized 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. |
event | String | Event description label. |
secondary_type | String | Secondary event type (e.g. shot type). |
event_team_abbr | String | Abbreviation of the team credited with the event. |
event_team_type | String | Whether the event team is home or away. |
description | String | Full text description of the event. |
period | Int64 | Period number. |
period_type | String | REGULAR, 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_time | String | Elapsed time in the period (MM:SS). |
period_seconds | Int64 | Elapsed seconds in the period. |
period_seconds_remaining | Int64 | Seconds remaining in the period. |
period_time_remaining | String | Time remaining in the period (MM:SS). |
game_seconds | Int64 | Elapsed seconds in the game. |
game_seconds_remaining | Int64 | Seconds remaining in regulation. |
home_score | Int64 | Home 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_score | Int64 | Away 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_name | String | Name of the primary event player. |
event_player_1_type | String | Role of the primary event player. |
event_player_1_id | Int64 | Player id of the primary event player. |
event_player_2_name | String | Name of the secondary event player. |
event_player_2_type | String | Role of the secondary event player. |
event_player_2_id | Int64 | Player id of the secondary event player. |
event_player_3_name | String | Name of the tertiary event player. |
event_player_3_type | String | Role of the tertiary event player. |
event_player_3_id | Int64 | Player ID of the tertiary event player. |
event_goalie_name | String | Name of the goalie on the event. |
event_goalie_id | Int64 | Player id of the goalie on the event. |
penalty_severity | String | Severity of the penalty. |
penalty_minutes | Int64 | Penalty minutes. |
strength_state | String | Strength state (e.g. 5v5, 5v4). |
strength_code | String | Strength state code (e.g., all, even, pp, pk). |
strength | String | Strength label (Even, Power Play, Shorthanded). |
empty_net | Boolean | Whether the net was empty. |
extra_attacker | Boolean | Whether an extra attacker was on the ice. |
x | Int64 | Raw x-coordinate of the event. |
y | Int64 | Raw y-coordinate of the event. |
x_fixed | Int64 | Normalized x coordinate (home shoots right). |
y_fixed | Int64 | Normalized y coordinate (home shoots right). |
shot_distance | Float64 | Distance of the shot from the net. |
shot_angle | Float64 | Angle of the shot relative to the net. |
home_skaters | Int64 | Number of home skaters on the ice. |
away_skaters | Int64 | Number of away skaters on the ice. |
home_on_1 | String | Name of home skater 1 on the ice. |
home_on_2 | String | Name of home skater 2 on the ice. |
home_on_3 | String | Name of home skater 3 on the ice. |
home_on_4 | String | Name of home skater 4 on the ice. |
home_on_5 | String | Name of home skater 5 on the ice. |
home_on_6 | String | Name of home skater 6 on the ice. |
home_on_7 | String | Name of home skater 7 on the ice. |
away_on_1 | String | Name of away skater 1 on the ice. |
away_on_2 | String | Name of away skater 2 on the ice. |
away_on_3 | String | Name of away skater 3 on the ice. |
away_on_4 | String | Name of away skater 4 on the ice. |
away_on_5 | String | Name of away skater 5 on the ice. |
away_on_6 | String | Name of away skater 6 on the ice. |
away_on_7 | String | Name of away skater 7 on the ice. |
home_goalie | String | Name of the home goalie on the ice. |
away_goalie | String | Name of the away goalie on the ice. |
num_on | Int64 | Number of players coming on (line change). |
players_on | String | Names of players coming on. |
num_off | Int64 | Number of players going off (line change). |
players_off | String | Names of players going off. |
game_id | Int64 | Unique game identifier. |
season | String | Season year (echoed from arg). |
season_type | String | Season type code (echoed from arg). |
home_abbr | String | Home team abbreviation. |
away_abbr | String | Away team abbreviation. |
event_idx | Int64 | Sequential event index within the game. |
event_id | Int64 | ESPN event id (echoed from arg). |
pptReplayUrl | String | URL to the play replay, if available. |
away_goalie_in | Int64 | Whether the away goalie is on the ice (1/0). |
home_goalie_in | Int64 | Whether the home goalie is on the ice (1/0). |
reason | String | Reason for the event (e.g. stoppage reason). |
secondaryReason | String | Secondary reason for a stoppage. |
ids_on | String | Player ids coming on. |
ids_off | String | Player ids going off. |
home_on_1_id | Int64 | Player id of home skater 1 on the ice. |
away_on_1_id | Int64 | Player id of away skater 1 on the ice. |
home_on_2_id | Int64 | Player id of home skater 2 on the ice. |
away_on_2_id | Int64 | Player id of away skater 2 on the ice. |
home_on_3_id | Int64 | Player id of home skater 3 on the ice. |
away_on_3_id | Int64 | Player id of away skater 3 on the ice. |
home_on_4_id | Int64 | Player id of home skater 4 on the ice. |
away_on_4_id | Int64 | Player id of away skater 4 on the ice. |
home_on_5_id | Int64 | Player id of home skater 5 on the ice. |
away_on_5_id | Int64 | Player id of away skater 5 on the ice. |
home_on_6_id | Int64 | Player id of home skater 6 on the ice. |
away_on_6_id | Int64 | Player id of away skater 6 on the ice. |
home_on_7_id | Int64 | Player id of home skater 7 on the ice. |
away_on_7_id | Int64 | Player id of away skater 7 on the ice. |
home_goalie_id | Int64 | Player ID of the home goalie on the ice. |
away_goalie_id | Int64 | Player ID of the away goalie on the ice. |
xg | Float64 | Expected goals value for the shot event. |
game_date | String | Game 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
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_name | type | description |
|---|---|---|
event_type | String | Normalized 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. |
event | String | Event description label. |
secondary_type | String | Secondary event type (e.g. shot type). |
event_team_abbr | String | Abbreviation of the team credited with the event. |
event_team_type | String | Whether the event team is home or away. |
description | String | Full text description of the event. |
period | Int32 | Period number. |
period_type | String | REGULAR, 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_time | String | Elapsed time in the period (MM:SS). |
period_seconds | Int32 | Elapsed seconds in the period. |
period_seconds_remaining | Int32 | Seconds remaining in the period. |
period_time_remaining | String | Time remaining in the period (MM:SS). |
game_seconds | Int32 | Elapsed seconds in the game. |
game_seconds_remaining | Int32 | Seconds remaining in regulation. |
home_score | Int32 | Home 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_score | Int32 | Away 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_name | String | Name of the primary event player. |
event_player_1_type | String | Role of the primary event player. |
event_player_1_id | Int32 | Player id of the primary event player. |
event_player_2_name | String | Name of the secondary event player. |
event_player_2_type | String | Role of the secondary event player. |
event_player_2_id | Int32 | Player id of the secondary event player. |
event_player_3_name | String | Name of the tertiary event player. |
event_player_3_type | String | Role of the tertiary event player. |
event_player_3_id | Int32 | Player ID of the tertiary event player. |
event_goalie_name | String | Name of the goalie on the event. |
event_goalie_id | Int32 | Player id of the goalie on the event. |
penalty_severity | String | Severity of the penalty. |
penalty_minutes | Int32 | Penalty minutes. |
strength_state | String | Strength state (e.g. 5v5, 5v4). |
strength_code | String | Strength state code (e.g., all, even, pp, pk). |
strength | String | Strength label (Even, Power Play, Shorthanded). |
empty_net | Boolean | Whether the net was empty. |
extra_attacker | Boolean | Whether an extra attacker was on the ice. |
x | Int32 | Raw x-coordinate of the event. |
y | Int32 | Raw y-coordinate of the event. |
x_fixed | Int32 | Normalized x coordinate (home shoots right). |
y_fixed | Int32 | Normalized y coordinate (home shoots right). |
shot_distance | Float64 | Distance of the shot from the net. |
shot_angle | Float64 | Angle of the shot relative to the net. |
home_skaters | Int32 | Number of home skaters on the ice. |
away_skaters | Int32 | Number of away skaters on the ice. |
home_on_1 | String | Name of home skater 1 on the ice. |
home_on_2 | String | Name of home skater 2 on the ice. |
home_on_3 | String | Name of home skater 3 on the ice. |
home_on_4 | String | Name of home skater 4 on the ice. |
home_on_5 | String | Name of home skater 5 on the ice. |
home_on_6 | String | Name of home skater 6 on the ice. |
home_on_7 | String | Name of home skater 7 on the ice. |
away_on_1 | String | Name of away skater 1 on the ice. |
away_on_2 | String | Name of away skater 2 on the ice. |
away_on_3 | String | Name of away skater 3 on the ice. |
away_on_4 | String | Name of away skater 4 on the ice. |
away_on_5 | String | Name of away skater 5 on the ice. |
away_on_6 | String | Name of away skater 6 on the ice. |
away_on_7 | String | Name of away skater 7 on the ice. |
home_goalie | String | Name of the home goalie on the ice. |
away_goalie | String | Name of the away goalie on the ice. |
num_on | Int32 | Number of players coming on (line change). |
players_on | String | Names of players coming on. |
num_off | Int32 | Number of players going off (line change). |
players_off | String | Names of players going off. |
game_id | Int32 | Unique game identifier. |
season | Int32 | Season year (echoed from arg). |
season_type | String | Season type code (echoed from arg). |
home_abbr | String | Home team abbreviation. |
away_abbr | String | Away team abbreviation. |
event_idx | Int32 | Sequential event index within the game. |
event_id | Int32 | ESPN event id (echoed from arg). |
pptReplayUrl | String | URL to the play replay, if available. |
away_goalie_in | Int32 | Whether the away goalie is on the ice (1/0). |
home_goalie_in | Int32 | Whether the home goalie is on the ice (1/0). |
reason | String | Reason for the event (e.g. stoppage reason). |
secondaryReason | String | Secondary reason for a stoppage. |
ids_on | String | Player ids coming on. |
ids_off | String | Player ids going off. |
home_on_1_id | Int32 | Player id of home skater 1 on the ice. |
away_on_1_id | Int32 | Player id of away skater 1 on the ice. |
home_on_2_id | Int32 | Player id of home skater 2 on the ice. |
away_on_2_id | Int32 | Player id of away skater 2 on the ice. |
home_on_3_id | Int32 | Player id of home skater 3 on the ice. |
away_on_3_id | Int32 | Player id of away skater 3 on the ice. |
home_on_4_id | Int32 | Player id of home skater 4 on the ice. |
away_on_4_id | Int32 | Player id of away skater 4 on the ice. |
home_on_5_id | Int32 | Player id of home skater 5 on the ice. |
away_on_5_id | Int32 | Player id of away skater 5 on the ice. |
home_on_6_id | Int32 | Player id of home skater 6 on the ice. |
away_on_6_id | Int32 | Player id of away skater 6 on the ice. |
home_on_7_id | Int32 | Player id of home skater 7 on the ice. |
away_on_7_id | Int32 | Player id of away skater 7 on the ice. |
home_goalie_id | Int32 | Player ID of the home goalie on the ice. |
away_goalie_id | Int32 | Player ID of the away goalie on the ice. |
xg | Float64 | Expected goals value for the shot event. |
load_nhl_pbp_lite(seasons=2010)