Skip to main content

NBA — additional Python functions — Analytics: nba_coach–nba_game

nba_coach_seasons​

nba_coach_seasons(seasons: 'int | list[int]', *, league_id: 'str' = '00', season_type: 'str' = 'regular-season', espn: 'bool' = True, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Head-coach seasons: W-L, ratings and four factors over the games each coach was on the bench for.

One row per season, team and head coach. A coach who took over mid-season gets his games only. Who coached each game: see sportsdataverse.nba.nba_coach_seasons.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26). The WNBA season is its calendar year.
league_idstr'00'"00" NBA or "10" WNBA.
season_typestr'regular-season'"regular-season" (default), "playoffs" or "play-in"; the postseason games go to the coach of the team's last regular-season game.
espnboolTrueRead ESPN's per-coach records (2002 on) to split a team-season that changed coach (about 90 requests a season). False credits only the seasons one coach had throughout.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id, coach_id): coach_id is the stats.nba.com coach id, team the team abbreviation, role "HC". team_games is the team's completed games of season_type, games / wins / losses / win_pct / pts / opp_pts the coach's (final scores), first_game_date / last_game_date his span. pbp_games, poss, opp_poss, poss_pts, opp_poss_pts, seconds and the o_* / d_* four-factor counts come from his games' possessions, and give off_rtg, def_rtg, net_rtg, pace and efg_pct .. opp_ft_rate. win_pct and the twelve rates have <m>_rank (1 = best), <m>_pct and <m>_n, within the season among coaches with half the most games; null under five coaches. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (2026 is 2025-26; the WNBA season is its calendar year).
team_idInt64stats.nba.com team id (the 10-digit franchise id).
teamStringTeam abbreviation (the stats schedule's).
coach_idInt64stats.nba.com coach id of the head coach (nba_stats_coaches / wnba_stats_coaches).
coachStringHead coach's name (stats.nba.com's staff list).
roleStringHC: head coach (the only role the table carries).
team_gamesInt64The team's completed games in the season (and season type); games < team_games means the coach shared the season.
first_game_dateDateDate of the coach's first credited game that season.
last_game_dateDateDate of the coach's last credited game that season.
gamesInt64Games credited to the coach: each completed game goes to the coach of record for it.
winsInt64Wins in the coach's games (final scores).
lossesInt64Losses in the coach's games (final scores).
win_pctFloat64Win fraction: wins divided by games, from the final scores.
ptsInt64Points scored in the coach's games (final scores).
opp_ptsInt64Points allowed in the coach's games (final scores).
pbp_gamesInt64The coach's games with published possessions; the ratings and four factors cover these.
possInt64Offensive possessions in the coach's games.
opp_possInt64Defensive possessions in the coach's games.
poss_ptsInt64Points scored on those possessions (the off_rtg numerator; can differ from pts by a few points a game).
opp_poss_ptsInt64Points allowed on those possessions (the def_rtg numerator).
secondsFloat64Game clock, in seconds, that the coach's possessions used (the pace denominator).
o_fgaFloat64The team's field-goal attempts in the coach's games (a four-factor count; null when the source has none).
d_fgaFloat64Opponents' field-goal attempts in the coach's games (a four-factor count).
o_fgmFloat64The team's field goals made in the coach's games (a four-factor count; null when the source has none).
d_fgmFloat64Opponents' field goals made in the coach's games (a four-factor count).
o_fg3mFloat64The team's three-pointers made in the coach's games (a four-factor count; null when the source has none).
d_fg3mFloat64Opponents' three-pointers made in the coach's games (a four-factor count).
o_ftaFloat64The team's free-throw attempts in the coach's games (a four-factor count; null when the source has none).
d_ftaFloat64Opponents' free-throw attempts in the coach's games (a four-factor count).
o_orebFloat64The team's offensive rebounds in the coach's games (a four-factor count; null when the source has none).
d_orebFloat64Opponents' offensive rebounds in the coach's games (a four-factor count).
o_drebFloat64The team's defensive rebounds in the coach's games (a four-factor count; null when the source has none).
d_drebFloat64Opponents' defensive rebounds in the coach's games (a four-factor count).
o_tovFloat64The team's turnovers in the coach's games (a four-factor count; null when the source has none).
d_tovFloat64Opponents' turnovers in the coach's games (a four-factor count).
o_ff_possFloat64The team's possessions counted for the turnover rate (the box possessions in college) in the coach's games (a four-factor count; null when the source has none).
d_ff_possFloat64Opponents' possessions counted for the turnover rate (the box possessions in college) in the coach's games (a four-factor count).
off_rtgFloat64Offensive rating: points scored per 100 offensive possessions, over the coach's games.
def_rtgFloat64Defensive rating: points allowed per 100 defensive possessions, over the coach's games.
net_rtgFloat64Net rating: off_rtg minus def_rtg.
paceFloat64Pace: possessions per 48 minutes (40 with league_id="10", the WNBA), the mean of poss and opp_poss over the game clock those possessions used.
efg_pctFloat64Effective field-goal percentage, (FGM + 0.5 * 3PM) / FGA, as a fraction.
tov_pctFloat64Turnovers per possession, as a fraction.
orb_pctFloat64Offensive rebound rate: offensive rebounds over offensive-rebound chances (own OREB plus the defense's DREB), as a fraction.
ft_rateFloat64Free-throw rate, FTA / FGA.
opp_efg_pctFloat64Opponents' effective field-goal percentage, as a fraction.
opp_tov_pctFloat64Opponents' turnovers per possession (turnovers forced), as a fraction.
opp_orb_pctFloat64Opponents' offensive rebound rate, as a fraction.
opp_ft_rateFloat64Opponents' free-throw rate, FTA / FGA.
win_pct_rankFloat64Rank of win_pct within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
off_rtg_rankFloat64Rank of off_rtg within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
def_rtg_rankFloat64Rank of def_rtg within the season among coaches with at least half the most games any team played (null under five coaches) (the lowest value ranks 1; ties average).
net_rtg_rankFloat64Rank of net_rtg within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
pace_rankFloat64Rank of pace within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
efg_pct_rankFloat64Rank of efg_pct within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
tov_pct_rankFloat64Rank of tov_pct within the season among coaches with at least half the most games any team played (null under five coaches) (the lowest value ranks 1; ties average).
orb_pct_rankFloat64Rank of orb_pct within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
ft_rate_rankFloat64Rank of ft_rate within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
opp_efg_pct_rankFloat64Rank of opp_efg_pct within the season among coaches with at least half the most games any team played (null under five coaches) (the lowest value ranks 1; ties average).
opp_tov_pct_rankFloat64Rank of opp_tov_pct within the season among coaches with at least half the most games any team played (null under five coaches) (the highest value ranks 1; ties average).
opp_orb_pct_rankFloat64Rank of opp_orb_pct within the season among coaches with at least half the most games any team played (null under five coaches) (the lowest value ranks 1; ties average).
opp_ft_rate_rankFloat64Rank of opp_ft_rate within the season among coaches with at least half the most games any team played (null under five coaches) (the lowest value ranks 1; ties average).
win_pct_pctFloat64Percentile of win_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
off_rtg_pctFloat64Percentile of off_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
def_rtg_pctFloat64Percentile of def_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
net_rtg_pctFloat64Percentile of net_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
pace_pctFloat64Percentile of pace among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
efg_pct_pctFloat64Percentile of efg_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
tov_pct_pctFloat64Percentile of tov_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
orb_pct_pctFloat64Percentile of orb_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
ft_rate_pctFloat64Percentile of ft_rate among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
opp_efg_pct_pctFloat64Percentile of opp_efg_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
opp_tov_pct_pctFloat64Percentile of opp_tov_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
opp_orb_pct_pctFloat64Percentile of opp_orb_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
opp_ft_rate_pctFloat64Percentile of opp_ft_rate among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value.
win_pct_nInt64Sample size of win_pct: games.
off_rtg_nInt64Sample size of off_rtg: offensive possessions.
def_rtg_nInt64Sample size of def_rtg: defensive possessions.
net_rtg_nInt64Sample size of net_rtg: offensive plus defensive possessions.
pace_nInt64Sample size of pace: the games with possessions (pbp_games).
efg_pct_nInt64Sample size of efg_pct: field-goal attempts.
tov_pct_nInt64Sample size of tov_pct: turnover-rate possessions.
orb_pct_nInt64Sample size of orb_pct: offensive-rebound chances.
ft_rate_nInt64Sample size of ft_rate: field-goal attempts.
opp_efg_pct_nInt64Sample size of opp_efg_pct: opponents' field-goal attempts.
opp_tov_pct_nInt64Sample size of opp_tov_pct: opponents' turnover-rate possessions.
opp_orb_pct_nInt64Sample size of opp_orb_pct: opponents' offensive-rebound chances.
opp_ft_rate_nInt64Sample size of opp_ft_rate: opponents' field-goal attempts.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10", or season_type is not one of the three above (checked before any data is loaded).

Example

from sportsdataverse.nba.nba_coach_seasons import nba_coach_seasons
coaches = nba_coach_seasons(2026)
coaches.sort("net_rtg", descending=True).select("coach", "team", "games", "wins", "net_rtg").head()

# Without ESPN (only the coaches who had the whole season)

nba_coach_seasons(2026, espn=False)

nba_cup_sim​

nba_cup_sim(season: 'int', *, as_of_date: 'dt.date | None' = None, n_sims: 'int' = 10000, seed: 'int' = 20261103, cup_schedule: 'pl.DataFrame | None' = None, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

NBA Cup sim as of a date: odds to win the group, take a wild card, reach each round and win.

Runs the season sim (sportsdataverse.nba.nba_season_sim.nba_season_sim: the as-of possession ridge with the preseason prior, one rating shift per team per simulated season, the same seed and draws) with the Cup inside it, ranks every simulated group with the Cup tiebreakers (nba_cup_standings), and plays the knockout: seed 1 hosts the wild card and seed 2 seed 3 in each conference, the semifinals neutral through 2025-26 and at the higher seed from 2026-27, the final neutral. A knockout game already played keeps its result.

Parameters

ParameterTypeDefaultDescription
seasonintThe season, named by the year it ends (2027 is 2026-27); from 2024.
as_of_datedate | NoneNoneGames on or after this date are simulated even when they have a score (a backtest). None: every final game counts as played.
n_simsint10000Simulated Cups (Monte Carlo error: the _se columns).
seedint20261103Seeds the generator; the same data and seed give the same output.
cup_scheduleDataFrame | NoneNoneA ~sportsdataverse.nba.nba_stats.nba_stats_scheduleleaguev2 frame; None fetches it from stats.nba.com (residential connection).
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per team (team_id, Int64), sorted by conference, group and mean group rank: the Group Play wins / losses / point_diff so far, the as-of adj_net_rtg, p_win_group, p_wild_card, p_quarterfinal (either), p_semifinal, p_final, p_champion, each with its Monte Carlo _se (sqrt(p (1 - p) / n_sims)), mean_group_rank and n_sims.

col_nametypedescription
seasonInt64Season, named by the year it ends (2027 is 2026-27).
as_of_dateDateThe as-of date: games on or after it are simulated. Null when every final game counts as played.
conferenceStringNBA conference (East / West).
cup_groupStringThe team's NBA Cup group (East Group A .. West Group C).
team_idInt64stats.nba.com team id (Int64).
winsInt64Group Play wins in the games already played.
lossesInt64Group Play losses in the games already played.
point_diffInt64Group Play point differential in the games already played, 0 for a game that went to overtime.
adj_net_rtgFloat64As-of adjusted net rating from the season sim's possession ridge: points per 100 over an average opponent on a neutral court.
p_win_groupFloat64Share of simulated Cups in which the team wins its group under the Cup tiebreakers.
p_wild_cardFloat64Share of simulated Cups in which the team takes its conference's wild card: the best second-place team.
p_quarterfinalFloat64Share of simulated Cups in which the team reaches the knockout: a group win or the wild card.
p_semifinalFloat64Share of simulated Cups in which the team wins its quarterfinal.
p_finalFloat64Share of simulated Cups in which the team reaches the final.
p_championFloat64Share of simulated Cups the team wins (the final included).
p_win_group_seFloat64Monte Carlo standard error of p_win_group: sqrt(p (1 - p) / n_sims).
p_wild_card_seFloat64Monte Carlo standard error of p_wild_card: sqrt(p (1 - p) / n_sims).
p_quarterfinal_seFloat64Monte Carlo standard error of p_quarterfinal: sqrt(p (1 - p) / n_sims).
p_semifinal_seFloat64Monte Carlo standard error of p_semifinal: sqrt(p (1 - p) / n_sims).
p_final_seFloat64Monte Carlo standard error of p_final: sqrt(p (1 - p) / n_sims).
p_champion_seFloat64Monte Carlo standard error of p_champion: sqrt(p (1 - p) / n_sims).
mean_group_rankFloat64Mean Group Play finish (1-5) over the simulated Cups.
n_simsInt64Number of simulated Cups behind every share on the row.

Raises

ExceptionDescription
ValueErrorIf season is before 2024 or n_sims < 1.

Example

import datetime as dt
from sportsdataverse.nba.nba_cup import nba_cup_sim
nba_cup_sim(2027, as_of_date=dt.date(2026, 11, 6)).select("team_id", "p_quarterfinal", "p_champion")

nba_cup_standings​

nba_cup_standings(season: 'int', *, as_of_date: 'dt.date | None' = None, cup_schedule: 'pl.DataFrame | None' = None, seed: 'int' = 20261103, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

NBA Cup Group Play standings as of a date, with the official tiebreak order and wild cards.

The rules (NBA.com, "Emirates NBA Cup 101", https://www.nba.com/news/nba-cup-101, read 2026-11-04) are in sportsdataverse.nba.nba_cup: Group Play record, then head-to-head, point differential and points scored in Group Play (overtime excluded), the previous regular-season record and a random drawing; the wild card is the best second-place team of each conference by the same order without head-to-head.

Parameters

ParameterTypeDefaultDescription
seasonintThe season, named by the year it ends (2027 is 2026-27); from 2024.
as_of_datedate | NoneNoneGames on or after this date are unplayed. None: every final game counts.
cup_scheduleDataFrame | NoneNoneA ~sportsdataverse.nba.nba_stats.nba_stats_scheduleleaguev2 frame for the season. None fetches it from stats.nba.com (a residential connection: the site hangs on datacenter IPs).
seedint20261103Seeds the random drawing, the last tiebreaker.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per team (stats.nba.com team_id, Int64), sorted by conference, group and rank: group_rank with wins / losses / games_remaining, the tiebreak inputs point_diff / points (overtime excluded) / prior_win_pct, tiebreak (the criterion that placed the team among those with its record; null when the record alone did), conference_rank (the group leaders 1-3, then the rest, the wild-card race), leads_group, holds_wild_card and knockout_seed (1-4 on the current table).

col_nametypedescription
seasonInt64Season, named by the year it ends (2027 is 2026-27).
as_of_dateDateThe as-of date: games on or after it are not counted. Null when every final game counts.
conferenceStringNBA conference (East / West).
cup_groupStringThe team's NBA Cup group (East Group A .. West Group C).
team_idInt64stats.nba.com team id (Int64).
group_rankInt64Place in the group (1-5) by Group Play record, then head-to-head, point differential, points scored, the previous season's record and a random drawing.
winsInt64Group Play wins.
lossesInt64Group Play losses.
games_remainingInt64Group Play games still to play.
point_diffInt64Group Play point differential, 0 for a game that went to overtime (the Cup rule).
pointsInt64Group Play points scored, overtime points excluded (the Cup rule).
prior_win_pctFloat64The previous regular season's winning percentage, the fourth tiebreaker.
tiebreakStringThe criterion that placed the team among the teams with its group record: head_to_head, point_diff, points, prior_record or random; null when the record alone did.
conference_rankInt64Rank in the conference as stats.nba.com orders it: the group leaders 1-3 (the seeding order), then the second-place teams (the wild-card race), then the rest, each by record and the tiebreakers without head-to-head.
leads_groupBooleanWhether the team leads (or won) its group.
holds_wild_cardBooleanWhether the team holds its conference's wild card on the current table (the best second-place team).
knockout_seedInt64Knockout seed (1-3 the group leaders by record, 4 the wild card) on the current table; null otherwise.

Raises

ExceptionDescription
ValueErrorIf season is before 2024 or the schedule does not hold six groups of five.

Example

import polars as pl
from sportsdataverse.nba.nba_cup import nba_cup_standings
nba_cup_standings(2026).filter(pl.col("knockout_seed").is_not_null())

nba_draft_lottery_odds​

nba_draft_lottery_odds(*, league_id: 'str' = '00', chances: 'Sequence[float] | None' = None, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Exact draft-lottery odds by pre-lottery slot: the chance each slot gets each pick.

NBA: the 2019 odds, 14 slots, four picks drawn. WNBA: two picks drawn, with the published chances for the number of lottery teams. Every ordered draw is enumerated (24,024 for the NBA), so the odds are exact, not simulated.

Parameters

ParameterTypeDefaultDescription
league_idstr'00'"00" NBA or "10" WNBA.
chancesSequence[float] | NoneNoneChances per slot, worst record first. Default: NBA_LOTTERY_CHANCES (NBA) or the five-team WNBA_LOTTERY_CHANCES table (WNBA, the 2026 lottery).
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (lottery_slot, pick): lottery_slot (1 = the worst record), chances (the slot's chances), pick and probability.

col_nametypedescription
lottery_slotInt64Pre-lottery slot, 1 = the worst record.
chancesFloat64The slot's chances in 1,000 (NBA 2019 table; WNBA published table or the caller's).
pickInt64Draft pick number.
probabilityFloat64Exact probability that the slot gets the pick, from enumerating every ordered draw.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10", or chances has a non-positive or non-finite entry or fewer entries than picks drawn.

Example

import polars as pl
from sportsdataverse.nba.nba_season_rules import nba_draft_lottery_odds
odds = nba_draft_lottery_odds()
odds.filter(pl.col("lottery_slot") == 1)

# A WNBA lottery with its own chances

nba_draft_lottery_odds(league_id="10", chances=[442, 276, 178, 104])

nba_epv_lineup_games​

nba_epv_lineup_games(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Per five-man unit and game: the EPV added with the unit on the floor.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26), from the booster's first training season (2022) on.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

epv_lineup_games of the seasons' plays, on-court from the nba_stats_game_lineups release: one row per (season, game_id, team_id, lineup_id) with off_epv, def_epv, net_epv and plays.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
lineup_idStringThe five player ids, sorted and joined with '-'.
off_epvFloat64EPV added by the unit's team with the ball while the unit was on.
def_epvFloat64EPV added by the opponent with the ball while the unit was on.
net_epvFloat64off_epv - def_epv.
playsInt64Play-by-play events with the unit on the floor.

Raises

ExceptionDescription
ValueErrorIf a season is before the first one served.

Example

from sportsdataverse.nba.nba_epv import nba_epv_lineup_games
units = nba_epv_lineup_games(2026)
units.filter(game_id="0022500101")

nba_epv_player_games​

nba_epv_player_games(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Per player and game: EPV added on the player's own actions and on-court EPV +/-.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26), from the booster's first training season (2022) on.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

epv_player_games of the seasons' plays, on-court from the nba_stats_game_lineups release: one row per (season, game_id, team_id, player_id) with epv_own, own_actions, off_epv_on, def_epv_on and epv_on. Ids are the stats.nba.com ids (Int64; game_id a String).

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
player_idInt64stats.nba.com player (person) id.
epv_ownFloat64EPV credited to the player's own events: as the offensive actor the play's epv_added, as a defensive actor its negative, a steal or block the negative of the turnover or miss it ended.
own_actionsInt64How many of the player's own events were credited.
off_epv_onFloat64EPV added by the player's team with the ball while the player was on the floor.
def_epv_onFloat64EPV added by the opponent with the ball while the player was on the floor.
epv_onFloat64On-court EPV +/-: off_epv_on - def_epv_on.

Raises

ExceptionDescription
ValueErrorIf a season is before the first one served.

Example

from sportsdataverse.nba.nba_epv import nba_epv_player_games
box = nba_epv_player_games(2026)
box.filter(game_id="0022500101")

nba_epv_plays​

nba_epv_plays(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

EPV and EPV added on every play-by-play event inside a possession.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26), from the booster's first training season (2022) on.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per event, in game order: season, game_id, possession_number, step (the event's place in the possession), order_index, action_number, the offense, defense and home team ids, the event's team_id / person_id / event_type / sub_type / description, the possession's starting ten, the state (EPV_FEATURES), points, remaining_points, is_last, next_in_period, epv, epv_start, epv_before, epv_after and epv_added. Every game of every season type is scored.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
possession_numberInt64The possession's number in the game (the possessions release's).
stepInt64The event's place in its possession, from 1.
order_indexInt64The event's order in the game's play-by-play.
action_numberInt64stats.nba.com action number of the event (the game lineups release's key).
offense_team_idInt64Team id of the offense (the team with the ball).
defense_team_idInt64Team id of the defense.
home_team_idInt64Team id of the home team.
team_idInt64Team id on the event: the team of the player who made it, or the team on a team event (a team rebound or timeout, which the feed files under person_id).
person_idInt64Player id on the event; the team id, or 0, on team events.
event_typeStringThe release's event type (made_shot, missed_shot, rebound, foul, free_throw, turnover, ...).
sub_typeStringThe release's event sub type (the foul or free-throw kind, the shot type, ...).
descriptionStringThe play-by-play text of the event.
off_player_1Int64stats.nba.com player id of offensive player 1 of 5 when the possession started.
off_player_2Int64stats.nba.com player id of offensive player 2 of 5 when the possession started.
off_player_3Int64stats.nba.com player id of offensive player 3 of 5 when the possession started.
off_player_4Int64stats.nba.com player id of offensive player 4 of 5 when the possession started.
off_player_5Int64stats.nba.com player id of offensive player 5 of 5 when the possession started.
def_player_1Int64stats.nba.com player id of defensive player 1 of 5 when the possession started.
def_player_2Int64stats.nba.com player id of defensive player 2 of 5 when the possession started.
def_player_3Int64stats.nba.com player id of defensive player 3 of 5 when the possession started.
def_player_4Int64stats.nba.com player id of defensive player 4 of 5 when the possession started.
def_player_5Int64stats.nba.com player id of defensive player 5 of 5 when the possession started.
start_typeInt64State: how the possession started, 0 dead ball, 1 timeout, 2 made shot, 3 missed shot, 4 live-ball turnover.
periodInt64State: the period, overtimes folded to 5.
seconds_remainingFloat64State: seconds left in the period after the event.
start_marginFloat64State: the offense's lead when the possession started (before its first event).
transitionInt64State: 0 half court, 1 transition window open (live start, no shot or dead ball yet, within 8 s), 2 a transition possession after its first shot.
last_eventInt64State: the event just processed, coded by its index in nba_epv.LAST_EVENTS (11 the start).
ft_pendingInt64State: free throws still to come in the trip.
shot_zoneInt64State: zone of the possession's latest shot, 0 none, 1 rim, 2 short, 3 mid two, 4 three.
pointsInt64The offense's points on the event.
remaining_pointsInt64The offense's points after the event to the end of the possession (the model's label).
is_lastBooleanWhether the event is its possession's last.
next_in_periodBooleanWhether another possession follows in the same period.
epvFloat64Expected points for the offense to the end of the possession, after the event.
epv_startFloat64EPV at the possession's start.
epv_beforeFloat64EPV before the event (the previous event's, or the start's).
epv_afterFloat64EPV after the event; when it ends the possession, minus the opponent's next start over an average start (0 at a period's end).
epv_addedFloat64EPV added: points + epv_after - epv_before, the offense's (the defense's is its negative).

Raises

ExceptionDescription
ValueErrorIf a season is before the first one served.

Example

from sportsdataverse.nba.nba_epv import nba_epv_plays
plays = nba_epv_plays(2026)
plays.filter(game_id="0022500101").sort("epv_added", descending=True).head(5)

nba_epv_team_games​

nba_epv_team_games(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Per team and game: EPV added on offense and allowed on defense.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26), from the booster's first training season (2022) on.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

epv_team_games of the seasons' plays: one row per (season, game_id, team_id) with opp_team_id, off_epv, def_epv, net_epv, poss, opp_poss, off_epv_per_poss and def_epv_per_poss.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
opp_team_idInt64The opponent's team id.
off_epvFloat64The team's EPV added with the ball over the game.
possInt64The team's possessions with at least one event.
def_epvFloat64The opponent's EPV added with the ball over the game.
opp_possInt64The opponent's possessions with at least one event.
net_epvFloat64off_epv - def_epv.
off_epv_per_possFloat64off_epv per possession.
def_epv_per_possFloat64def_epv per possession.

Raises

ExceptionDescription
ValueErrorIf a season is before the first one served.

Example

import polars as pl
from sportsdataverse.nba.nba_epv import nba_epv_team_games
teams = nba_epv_team_games(2026)
teams.group_by("team_id").agg(pl.col("off_epv_per_poss").mean()).sort("off_epv_per_poss")

nba_foul_drawing​

nba_foul_drawing(season: 'str', *, league_id: 'str' = '00', base: 'Optional[pl.DataFrame]' = None, advanced: 'Optional[pl.DataFrame]' = None, player_mix: 'Optional[pl.DataFrame]' = None, return_as_pandas: 'bool' = False) -> 'Union[pl.DataFrame, pd.DataFrame]'

Expected FTA + residual foul-drawing skill from Synergy play-type mix.

lg_ft_rate_t = poss-weighted league mean of ft_freq for play type t (Σ_players(ft_freq_t·poss_t) / Σ_players(poss_t)). expected_fta = scale · Σ_t poss_t · lg_ft_rate_t; foul_draw_skill = 100·(fta − expected_fta)/poss.

ft_freq (Synergy's ft_poss_pct) counts FT-drawing trips, not individual free-throw attempts (a shooting foul is typically a 2-shot trip) -- scale = Σ actual fta / Σ raw trip-based estimate is derived from the fetched season itself (never hard-coded) so the trip-to-attempt conversion self-normalizes and Σ expected_fta ≡ Σ fta holds exactly.

Parameters

ParameterTypeDefaultDescription
seasonstrSeason string, e.g. "2023-24".
league_idstr'00'"00" NBA (default), "10" WNBA, "20" G-League.
baseOptional[DataFrame]NoneInjected nba_stats_leaguedashplayerstats (Base measure) frame: player_id, fta, poss (bypasses the live fetch).
advancedOptional[DataFrame]NoneInjected Advanced-measure frame with player_id, pfd (personal fouls drawn); optional -- pfd is null when omitted (fta is the always-present proxy).
player_mixOptional[DataFrame]NoneInjected Synergy player-level offensive mix: player_id, play_type, poss, ft_freq.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per player: player_id (Int64), poss/fta/ expected_fta/foul_draw_skill (Float64), pfd (Float64, null when advanced has no data for that player or is omitted). Zero-row frame with this schema when the inputs are empty (sparse-coverage leagues never raise).

No returns table is published for this function: no capture: it reads stats.nba.com, which answers HTTP 403 to the datacenter IP the docs are built on; the function works from a residential IP.

Example

from sportsdataverse.nba import nba_foul_drawing
f = nba_foul_drawing("2023-24")
print(f.sort("foul_draw_skill", descending=True).head(10))

# Injected offline (oracle / test) path

f = nba_foul_drawing("2023-24", base=base_df, player_mix=mix_df)

# Pipeline next step

f.filter(pl.col("poss") >= 200).sort("foul_draw_skill", descending=True)

nba_game_flow​

nba_game_flow(seasons: 'int | list[int]', *, league_id: 'str' = '00', season_type: 'str' = 'regular-season', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Game flow per team and game: runs, droughts, kills, lead changes, time leading and game control.

The definitions are in sportsdataverse._common.game_flow. Over the 1,315 games of the 2025-26 NBA season (every season type), lead_changes equals the official cdn.nba.com box score's in every game and times_tied and largest_lead in all but one; over the 310 games of the 2025 WNBA season all three equal cdn.wnba.com's in every game.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26). The WNBA season is its calendar year.
league_idstr'00'"00" NBA or "10" WNBA.
season_typestr'regular-season'"regular-season" (default), "preseason", "playoffs" or "play-in", matched to the schedule's season_type.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, game_id, team_id): opp_team_id, is_home, pts / opp_pts and won; game_seconds; lead_sec / trail_sec / tied_sec and lead_pct; lead_changes and times_tied (game totals); largest_lead, largest_deficit and comeback; max_run, runs_10 and opp_runs_10 (unanswered-point runs); longest_drought_sec; avg_margin and avg_wp (game control); def_poss, stops, kills and double_kills. Ids are the stats.nba.com ids (Int64; game_id a String). Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
opp_team_idInt64The opponent's team id.
is_homeBooleanTrue for the home side.
ptsInt64The team's final points: its running score after the last play.
opp_ptsInt64The opponent's final points.
wonBooleanTrue when pts > opp_pts.
game_secondsFloat64Game length in seconds: regulation plus the overtimes played.
lead_secFloat64Game-clock seconds with the team ahead; the score after a play holds until the next play.
trail_secFloat64Game-clock seconds with the team behind.
tied_secFloat64Game-clock seconds with the score level, the clock before the first play included.
lead_pctFloat64lead_sec / game_seconds.
lead_changesInt64How often the leader flipped (a tie is not a lead, and the first lead is not a change); the same on both rows of a game.
times_tiedInt64How often the score became level, the 0-0 start not counted; the same on both rows of a game.
largest_leadInt64The team's biggest lead in points (0 if never ahead).
largest_deficitInt64The team's biggest deficit in points (0 if never behind).
comebackInt64largest_deficit for a game the team won, else 0.
max_runInt64The most points the team scored in a row with the opponent scoring none (an n-0 run); a score correction comes off the run of the side it lowers. 0 if the team never scored.
runs_10Int64The team's runs of 10 or more unanswered points.
opp_runs_10Int64The opponent's runs of 10 or more unanswered points (a non-D1 opponent's included).
longest_drought_secFloat64The longest stretch of game clock between two of the team's scores, counted from the tip to its first score and from its last score to the end.
avg_marginFloat64Game control: the team's score margin averaged over the game clock.
avg_wpFloat64Game control: the team's in-game win probability averaged over the game clock (the league's in-game model with a home-court-only prior, 0.5 at a neutral site).
def_possInt64The team's defensive possessions (every row of the possessions release); null for a game with no published possessions.
stopsInt64Defensive possessions on which the opponent scored no points.
killsInt64Kills: each run of n straight stops adds n // 3 (a kill is three straight stops; a run of stops goes on across period breaks).
double_killsInt64Double kills: each run of n straight stops adds n // 6 (six straight stops are two kills and one double kill).

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10", or season_type is not one of the four above.

Example

from sportsdataverse.nba.nba_game_flow import nba_game_flow
flow = nba_game_flow(2026)
flow.sort("comeback", descending=True).head()

nba_game_lineups_used​

nba_game_lineups_used(seasons: 'int | list[int]', *, league_id: 'str' = '00', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

The lineups used: per five-man unit and game, minutes, possessions, +/- and ratings.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26). The WNBA season is its calendar year.
league_idstr'00'"00" NBA or "10" WNBA.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, game_id, team_id, lineup_id): lineup_id (the five player ids sorted and joined with -), player_1..5, and the same totals and ratings as nba_game_player_impact, sorted by minutes within each team and game. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
opp_team_idInt64The opponent's team id.
lineup_idStringThe five player ids of the unit, sorted and joined with '-'.
player_1Int64Player 1 of the unit, in lineup_id order.
player_2Int64Player 2 of the unit, in lineup_id order.
player_3Int64Player 3 of the unit, in lineup_id order.
player_4Int64Player 4 of the unit, in lineup_id order.
player_5Int64Player 5 of the unit, in lineup_id order.
minutesFloat64Game-clock minutes on the floor (seconds / 60).
secondsFloat64Game-clock seconds on the floor: the clock that ran into each action, credited to the lineup at that action.
possInt64Offensive possessions on the floor (a possession counts for the five on the floor when it starts).
opp_possInt64Defensive possessions on the floor.
ptsInt64The team's points while on the floor, each scoring action credited to the lineup at that action (a free throw to the lineup at the last foul, the official scorer's rule).
opp_ptsInt64The opponent's points while on the floor, credited as pts is.
plus_minusInt64On-court +/-: pts - opp_pts.
off_rtgFloat64On-court offensive rating: pts per 100 poss; null with no offensive possessions.
def_rtgFloat64On-court defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions.
net_rtgFloat64On-court net rating: off_rtg - def_rtg; null when either is null.
off_rtg_nInt64Sample size of off_rtg: poss.
def_rtg_nInt64Sample size of def_rtg: opp_poss.
net_rtg_nInt64Sample size of net_rtg: poss + opp_poss.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10".

Example

from sportsdataverse.nba.nba_game_impact import nba_game_lineups_used
units = nba_game_lineups_used(2026)
units.filter(game_id="0022500101").group_by("team_id").head(5)

nba_game_on_off​

nba_game_on_off(seasons: 'int | list[int]', *, league_id: 'str' = '00', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

In-game on/off: per player and game, the team with him on the floor and the rest of its game.

The definitions are in sportsdataverse._common.game_stints.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26). The WNBA season is its calendar year.
league_idstr'00'"00" NBA or "10" WNBA.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, game_id, team_id, player_id): opp_team_id, for each side (_on, _off) minutes, poss, opp_poss, pts, opp_pts, plus_minus, off_rtg, def_rtg and net_rtg; <rating>_diff (on minus off) and every rating's _n. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
opp_team_idInt64The opponent's team id.
player_idInt64stats.nba.com player (person) id.
minutes_onFloat64Game-clock minutes of the team's game with the player on the floor.
poss_onInt64The team's offensive possessions with the player on the floor (a possession belongs to the five on the floor when it starts).
opp_poss_onInt64The team's defensive possessions with the player on the floor.
pts_onInt64The team's points with the player on the floor, each scoring action credited to the lineup at that action (a free throw to the lineup at the last foul).
opp_pts_onInt64The opponent's points with the player on the floor, credited as pts_on is.
plus_minus_onInt64pts_on - opp_pts_on.
off_rtg_onFloat64Offensive rating with the player on the floor: pts_on per 100 poss_on; null with no possessions.
def_rtg_onFloat64Defensive rating with the player on the floor: opp_pts_on per 100 opp_poss_on; null with no possessions.
net_rtg_onFloat64Net rating with the player on the floor: off_rtg_on - def_rtg_on; null when either is null.
minutes_offFloat64Game-clock minutes of the team's game with the player off the floor (the rest of the team's game).
poss_offInt64The team's offensive possessions with the player off the floor (the rest of the team's game) (a possession belongs to the five on the floor when it starts).
opp_poss_offInt64The team's defensive possessions with the player off the floor (the rest of the team's game).
pts_offInt64The team's points with the player off the floor (the rest of the team's game), each scoring action credited to the lineup at that action (a free throw to the lineup at the last foul).
opp_pts_offInt64The opponent's points with the player off the floor (the rest of the team's game), credited as pts_off is.
plus_minus_offInt64pts_off - opp_pts_off.
off_rtg_offFloat64Offensive rating with the player off the floor (the rest of the team's game): pts_off per 100 poss_off; null with no possessions.
def_rtg_offFloat64Defensive rating with the player off the floor (the rest of the team's game): opp_pts_off per 100 opp_poss_off; null with no possessions.
net_rtg_offFloat64Net rating with the player off the floor (the rest of the team's game): off_rtg_off - def_rtg_off; null when either is null.
off_rtg_diffFloat64On-off offensive rating: off_rtg_on - off_rtg_off; null when either is null.
def_rtg_diffFloat64On-off defensive rating: def_rtg_on - def_rtg_off; null when either is null.
net_rtg_diffFloat64On-off net rating: net_rtg_on - net_rtg_off; null when either is null.
off_rtg_on_nInt64Sample size of off_rtg_on: poss_on.
def_rtg_on_nInt64Sample size of def_rtg_on: opp_poss_on.
net_rtg_on_nInt64Sample size of net_rtg_on: poss_on + opp_poss_on.
off_rtg_off_nInt64Sample size of off_rtg_off: poss_off.
def_rtg_off_nInt64Sample size of def_rtg_off: opp_poss_off.
net_rtg_off_nInt64Sample size of net_rtg_off: poss_off + opp_poss_off.
off_rtg_diff_nInt64Sample size of off_rtg_diff: the smaller of off_rtg_on_n and off_rtg_off_n.
def_rtg_diff_nInt64Sample size of def_rtg_diff: the smaller of def_rtg_on_n and def_rtg_off_n.
net_rtg_diff_nInt64Sample size of net_rtg_diff: the smaller of net_rtg_on_n and net_rtg_off_n.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10".

Example

from sportsdataverse.nba.nba_game_stints import nba_game_on_off
nba_game_on_off(2026).filter(game_id="0022500101")

nba_game_player_box_splits​

nba_game_player_box_splits(seasons: 'int | list[int]', *, league_id: 'str' = '00', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Player box by game, period and garbage time: minutes and counts from the play-by-play.

The definitions are in sportsdataverse._common.game_stints (~sportsdataverse._common.game_stints.game_player_box_splits).

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26). The WNBA season is its calendar year.
league_idstr'00'"00" NBA or "10" WNBA.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

Per (season, game_id, team_id, player_id): the family="all" row (the game), one family="period" row per period played (split p1 .. p4, p5 on for the overtimes; period; on_floor_at_end) and the two family="garbage" rows (garbage_time, not_garbage_time: the box with garbage time out is the latter). Each has seconds / minutes on the floor and points, fgm / fga, fg3m / fg3a, ftm / fta, oreb / dreb / reb, ast, stl, blk, tov and pf. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
player_idInt64stats.nba.com player (person) id.
familyStringSplit family: all (the game), period (one row per period he played) or garbage (garbage time in and out).
splitStringThe split: all; p1, p2, ... for a period (periods past regulation are the overtimes); garbage_time or not_garbage_time (his box with garbage time removed).
periodInt64The period of a period row; null on the other families.
secondsFloat64Game-clock seconds he was on the floor in the split (an action's clock goes to the lineup at it).
minutesFloat64Game-clock minutes on the floor in the split (seconds / 60).
pointsInt64Points the player scored: 2 or 3 per made field goal and 1 per made free throw.
fgmInt64Field goals made.
fgaInt64Field goals attempted.
fg3mInt64Three-pointers made.
fg3aInt64Three-pointers attempted.
ftmInt64Free throws made.
ftaInt64Free throws attempted.
orebInt64Offensive rebounds (a team rebound is no player's).
drebInt64Defensive rebounds (a team rebound is no player's).
rebInt64Total rebounds: oreb + dreb.
astInt64Assists: made field goals the play-by-play credits him as the passer on.
stlInt64Steals he is credited with.
blkInt64Shots he blocked.
tovInt64Turnovers (a team turnover is no player's).
pfInt64Personal fouls (technicals are not counted).
on_floor_at_endBooleanOn a period row, whether he was in his side's lineup at the period's last action; null on the other families.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10".

Example

from sportsdataverse.nba.nba_game_stints import nba_game_player_box_splits
splits = nba_game_player_box_splits(2026)
splits.filter(family="garbage", split="not_garbage_time").head()

nba_game_player_impact​

nba_game_player_impact(seasons: 'int | list[int]', *, league_id: 'str' = '00', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

The game impact box: per player and game, minutes, on-court possessions, +/- and ratings.

The on-court +/- is the official box score's: on the 2025-26 NBA season it equals stats.nba.com's plus_minus_points on 91% of player-games, the rest being on-court lineup errors in the source. The definitions are in sportsdataverse._common.game_impact.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26). The WNBA season is its calendar year.
league_idstr'00'"00" NBA or "10" WNBA.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, game_id, team_id, player_id): opp_team_id, minutes and seconds on the floor, poss / opp_poss (offensive / defensive possessions on the floor), pts / opp_pts (points scored / allowed while on), plus_minus, off_rtg / def_rtg / net_rtg (per 100 possessions) and their _n sample sizes. Ids are the stats.nba.com ids (Int64; game_id a String). Every game of every season type is included. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
opp_team_idInt64The opponent's team id.
player_idInt64stats.nba.com player (person) id.
minutesFloat64Game-clock minutes on the floor (seconds / 60).
secondsFloat64Game-clock seconds on the floor: the clock that ran into each action, credited to the lineup at that action.
possInt64Offensive possessions on the floor (a possession counts for the five on the floor when it starts).
opp_possInt64Defensive possessions on the floor.
ptsInt64The team's points while on the floor, each scoring action credited to the lineup at that action (a free throw to the lineup at the last foul, the official scorer's rule).
opp_ptsInt64The opponent's points while on the floor, credited as pts is.
plus_minusInt64On-court +/-: pts - opp_pts.
off_rtgFloat64On-court offensive rating: pts per 100 poss; null with no offensive possessions.
def_rtgFloat64On-court defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions.
net_rtgFloat64On-court net rating: off_rtg - def_rtg; null when either is null.
off_rtg_nInt64Sample size of off_rtg: poss.
def_rtg_nInt64Sample size of def_rtg: opp_poss.
net_rtg_nInt64Sample size of net_rtg: poss + opp_poss.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10".

Example

from sportsdataverse.nba.nba_game_impact import nba_game_player_impact
box = nba_game_player_impact(2026)
box.filter(game_id="0022500101")

nba_game_stints​

nba_game_stints(seasons: 'int | list[int]', *, league_id: 'str' = '00', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Game stints: per player and game, every stretch on the floor with its clock, points and possessions.

The definitions are in sportsdataverse._common.game_stints.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26). The WNBA season is its calendar year.
league_idstr'00'"00" NBA or "10" WNBA.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, game_id, team_id, player_id, stint_number): opp_team_id, stint_number (1 = his first in the game), period, clock_in / clock_out (the period clock, seconds left, when the stint began and ended), seconds / minutes on the floor, poss / opp_poss (offensive / defensive possessions started), pts / opp_pts (team points scored / allowed), plus_minus and the player's own box in the stint (nba_box_events): points, fgm / fga, fg3m / fg3a, ftm / fta, oreb / dreb / reb, ast, stl, blk, tov and pf. Ids are the stats.nba.com ids (Int64; game_id a String). Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idStringstats.nba.com game id (e.g. 0022500101).
team_idInt64stats.nba.com team id.
opp_team_idInt64The opponent's team id.
player_idInt64stats.nba.com player (person) id.
stint_numberInt64The stint's place among the player's stints in the game, from 1 in game order. A stint is a run of consecutive actions of one period with him on the floor.
periodInt64Period of the stint (a stint never spans a period end).
clock_inFloat64Period clock (seconds left) when the stint began: the clock at the action before his first.
clock_outFloat64Period clock (seconds left) when the stint ended: the clock at his last action.
secondsFloat64Game-clock seconds of the stint: the clock that ran into each of its actions.
minutesFloat64Game-clock minutes of the stint (seconds / 60).
possInt64Offensive possessions that started during the stint (each counted on the lineup at the action that starts it).
opp_possInt64Defensive possessions that started during the stint, counted as poss is.
ptsInt64The team's points during the stint, each scoring action credited to the lineup at that action (a free throw to the lineup at the last foul).
opp_ptsInt64The opponent's points during the stint, credited as pts is.
plus_minusInt64The stint's +/-: pts - opp_pts.
pointsInt64Points the player scored: 2 or 3 per made field goal and 1 per made free throw, his own, on the stint's actions.
fgmInt64Field goals made, his own, on the stint's actions.
fgaInt64Field goals attempted, his own, on the stint's actions.
fg3mInt64Three-pointers made, his own, on the stint's actions.
fg3aInt64Three-pointers attempted, his own, on the stint's actions.
ftmInt64Free throws made, his own, on the stint's actions.
ftaInt64Free throws attempted, his own, on the stint's actions.
orebInt64Offensive rebounds (a team rebound is no player's), his own, on the stint's actions.
drebInt64Defensive rebounds (a team rebound is no player's), his own, on the stint's actions.
rebInt64Total rebounds in the stint: oreb + dreb.
astInt64Assists: made field goals the play-by-play credits him as the passer on, his own, on the stint's actions.
stlInt64Steals, his own, on the stint's actions.
blkInt64Blocked shots, his own, on the stint's actions.
tovInt64Turnovers (a team turnover is no player's), his own, on the stint's actions.
pfInt64Personal fouls (technicals are not counted), his own, on the stint's actions.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10".

Example

from sportsdataverse.nba.nba_game_stints import nba_game_stints
stints = nba_game_stints(2026)
stints.filter(game_id="0022500101")