Skip to main content
Version: 0.2.0

NBA — additional Python functions — Analytics: nba_player–nba_raw

nba_player_shot_zones​

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

Season shot profile by zone per player: rim / mid / corner 3 / above-the-break 3.

One row per player, team and season over the regular season (a traded player has a row per team). Zones and the unlocated attempts are as in the module docstring.

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, team_id, player_id) (stats.nba.com ids, Int64) with player_name, games, fga, fgm, unlocated_fga and, for each zone z (rim, mid, corner_3, above_break_3), {z}_fga, {z}_fgm, {z}_ast (assisted makes), {z}_fg_pct, {z}_freq (share of the located attempts) and {z}_ast_pct (share of the makes assisted). The four {z}_fga plus unlocated_fga add up to fga. Every rate has <m>_n (its denominator), <m>_rank (1 = highest) and <m>_pct (the Weibull percentile), ranked within the season among players whose <m>_n reaches the rate's gate and null under ten players. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (2026 is 2025-26).
team_idInt64stats.nba.com team id.
player_idInt64stats.nba.com player (person) id.
player_nameStringPlayer name as the shots release spells it.
gamesInt64The player's regular-season games with at least one field-goal attempt for this team.
fgaInt64Field-goal attempts by the player (regular-season games).
fgmInt64Field goals made by the player.
unlocated_fgaInt64Attempts by the player with no real location (the WNBA's 1997-2010 hoop-centre placeholders; 0 elsewhere): counted in fga, in no zone.
rim_fgaInt64Attempts by the player at the rim (the restricted area: shot_distance under 4 ft).
rim_fgmInt64Makes by the player at the rim (the restricted area: shot_distance under 4 ft).
rim_astInt64Assisted makes by the player at the rim (the restricted area: shot_distance under 4 ft).
mid_fgaInt64Attempts by the player in the mid zone (every other two: the paint outside the restricted area and the mid-range).
mid_fgmInt64Makes by the player in the mid zone (every other two: the paint outside the restricted area and the mid-range).
mid_astInt64Assisted makes by the player in the mid zone (every other two: the paint outside the restricted area and the mid-range).
corner_3_fgaInt64Attempts by the player from the corner (a three from the baseline band, y_legacy <= 87.5, below the break).
corner_3_fgmInt64Makes by the player from the corner (a three from the baseline band, y_legacy <= 87.5, below the break).
corner_3_astInt64Assisted makes by the player from the corner (a three from the baseline band, y_legacy <= 87.5, below the break).
above_break_3_fgaInt64Attempts by the player from above the break (every other three).
above_break_3_fgmInt64Makes by the player from above the break (every other three).
above_break_3_astInt64Assisted makes by the player from above the break (every other three).
rim_fg_pctFloat64rim_fgm / rim_fga; null with no attempt.
rim_freqFloat64rim_fga / (fga - unlocated_fga): the zone's share of the located attempts (the four zones add up to 1); null with none.
rim_ast_pctFloat64Share of rim_fgm that were assisted, over the makes (every make's assist is in its description); null with none.
mid_fg_pctFloat64mid_fgm / mid_fga; null with no attempt.
mid_freqFloat64mid_fga / (fga - unlocated_fga): the zone's share of the located attempts (the four zones add up to 1); null with none.
mid_ast_pctFloat64Share of mid_fgm that were assisted, over the makes (every make's assist is in its description); null with none.
corner_3_fg_pctFloat64corner_3_fgm / corner_3_fga; null with no attempt.
corner_3_freqFloat64corner_3_fga / (fga - unlocated_fga): the zone's share of the located attempts (the four zones add up to 1); null with none.
corner_3_ast_pctFloat64Share of corner_3_fgm that were assisted, over the makes (every make's assist is in its description); null with none.
above_break_3_fg_pctFloat64above_break_3_fgm / above_break_3_fga; null with no attempt.
above_break_3_freqFloat64above_break_3_fga / (fga - unlocated_fga): the zone's share of the located attempts (the four zones add up to 1); null with none.
above_break_3_ast_pctFloat64Share of above_break_3_fgm that were assisted, over the makes (every make's assist is in its description); null with none.
rim_fg_pct_nInt64Sample size of rim_fg_pct: rim_fga.
rim_freq_nInt64Sample size of rim_freq: located attempts (fga - unlocated_fga).
rim_ast_pct_nInt64Sample size of rim_ast_pct: makes in the zone.
mid_fg_pct_nInt64Sample size of mid_fg_pct: mid_fga.
mid_freq_nInt64Sample size of mid_freq: located attempts (fga - unlocated_fga).
mid_ast_pct_nInt64Sample size of mid_ast_pct: makes in the zone.
corner_3_fg_pct_nInt64Sample size of corner_3_fg_pct: corner_3_fga.
corner_3_freq_nInt64Sample size of corner_3_freq: located attempts (fga - unlocated_fga).
corner_3_ast_pct_nInt64Sample size of corner_3_ast_pct: makes in the zone.
above_break_3_fg_pct_nInt64Sample size of above_break_3_fg_pct: above_break_3_fga.
above_break_3_freq_nInt64Sample size of above_break_3_freq: located attempts (fga - unlocated_fga).
above_break_3_ast_pct_nInt64Sample size of above_break_3_ast_pct: makes in the zone.
rim_fg_pct_rankFloat64Rank of rim_fg_pct within the season (the highest ranks 1; ties average), among players whose rim_fg_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
rim_freq_rankFloat64Rank of rim_freq within the season (the highest ranks 1; ties average), among players whose rim_freq_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
rim_ast_pct_rankFloat64Rank of rim_ast_pct within the season (the highest ranks 1; ties average), among players whose rim_ast_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
mid_fg_pct_rankFloat64Rank of mid_fg_pct within the season (the highest ranks 1; ties average), among players whose mid_fg_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
mid_freq_rankFloat64Rank of mid_freq within the season (the highest ranks 1; ties average), among players whose mid_freq_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
mid_ast_pct_rankFloat64Rank of mid_ast_pct within the season (the highest ranks 1; ties average), among players whose mid_ast_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
corner_3_fg_pct_rankFloat64Rank of corner_3_fg_pct within the season (the highest ranks 1; ties average), among players whose corner_3_fg_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
corner_3_freq_rankFloat64Rank of corner_3_freq within the season (the highest ranks 1; ties average), among players whose corner_3_freq_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
corner_3_ast_pct_rankFloat64Rank of corner_3_ast_pct within the season (the highest ranks 1; ties average), among players whose corner_3_ast_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
above_break_3_fg_pct_rankFloat64Rank of above_break_3_fg_pct within the season (the highest ranks 1; ties average), among players whose above_break_3_fg_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
above_break_3_freq_rankFloat64Rank of above_break_3_freq within the season (the highest ranks 1; ties average), among players whose above_break_3_freq_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
above_break_3_ast_pct_rankFloat64Rank of above_break_3_ast_pct within the season (the highest ranks 1; ties average), among players whose above_break_3_ast_pct_n reaches the rate's split-half gate (PLAYER_MIN_N); null under the gate, for a rate with no gate (never half signal), or with fewer than ten players ranked.
rim_fg_pct_pctFloat64Percentile of rim_fg_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
rim_freq_pctFloat64Percentile of rim_freq within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
rim_ast_pct_pctFloat64Percentile of rim_ast_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
mid_fg_pct_pctFloat64Percentile of mid_fg_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
mid_freq_pctFloat64Percentile of mid_freq within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
mid_ast_pct_pctFloat64Percentile of mid_ast_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
corner_3_fg_pct_pctFloat64Percentile of corner_3_fg_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
corner_3_freq_pctFloat64Percentile of corner_3_freq within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
corner_3_ast_pct_pctFloat64Percentile of corner_3_ast_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
above_break_3_fg_pct_pctFloat64Percentile of above_break_3_fg_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
above_break_3_freq_pctFloat64Percentile of above_break_3_freq within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
above_break_3_ast_pct_pctFloat64Percentile of above_break_3_ast_pct within the season among the same ranked rows: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10" (checked before any data is loaded).

Example

from sportsdataverse.nba.nba_shot_zone_profiles import nba_player_shot_zones
zones = nba_player_shot_zones(2025)
zones.sort("corner_3_fga", descending=True).select("player_name", "corner_3_fga", "corner_3_fg_pct").head()

# WNBA via ``league_id``

wnba = nba_player_shot_zones(2025, league_id="10")

nba_player_war​

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

WAR and VORP per player-season, from our BPM, RAPM and BOBAN (regular season).

Each rating is anchored to the team (its players' possession-weighted mean rating over the season is the team's net rating / 5; it is a season constraint, not an estimate for each five-man lineup) and centred on the league, so 0 is a league-average player. vorp is points per 100 team possessions above a replacement player over one team's season of possessions (a full season of possessions at R + 1 per 100 is a VORP of 1); war is wins above replacement. A replacement-level player has 0, and a season's war adds up to the league's wins minus those of a team of replacement players. rating / war are the mean of the three sources; rating_<s> / war_<s> are each one. The replacement level and points per win are fitted per league (~sportsdataverse._common.player_war.REPLACEMENT_LEVEL, ~sportsdataverse._common.player_war.PTS_PER_WIN).

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, player_id) (stats.nba.com ids, Int64): player_name, team_id (the team he played most possessions for), teams (how many he played for), min, poss (on-court possessions, offensive plus defensive over 2), rating and rating_bpm / rating_rapm / rating_boban (anchored, per 100), vorp, war with war_lo / war_hi (a nominal 90% interval from a bootstrap over each team-season's games: the sampling uncertainty of the team side and the playing time) and war_bpm / war_rapm / war_boban (the source spread), with _rank (1 = most), _pct and _n (possessions) for vorp and war among every player of the season. Sorted by season and war. 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).
player_idInt64stats.nba.com player id.
player_nameStringPlayer name, from the player impact release.
team_idInt64stats.nba.com team id of the team he played the most possessions for.
teamsInt64How many teams he played for in the regular season.
team_idsStringEvery team he played for that season, comma-separated, most possessions first (the first is team_id); roster_tiers puts him on each.
minFloat64Regular-season minutes (the player impact release's).
possFloat64On-court possessions, offensive plus defensive over 2, counted from the stats.nba.com possessions (every possession row, BB-D3's convention). The minutes basis of vorp and war.
ratingFloat64Points per 100 possessions above a league-average player: the mean of rating_bpm, rating_rapm and rating_boban.
rating_bpmFloat64Our BPM per 100, team-anchored and centred: the release's bpm with its team constant repaired (minute-weighted team mean = net rating / 5, BPM 2.0's), minus the player's team mean, plus the team's net rating / 5, centred so the league's possession-weighted mean is 0.
rating_rapmFloat64Our prior-informed RAPM (adj_rapm) per 100, team-anchored and centred like rating_bpm. Only the net adj_rapm is read: the o_adj_rapm / d_adj_rapm split carries a +11 / -11 offset.
rating_bobanFloat64Our BOBAN (boban_filtered_skill) per 100, team-anchored and centred like rating_bpm.
vorpFloat64Value over replacement player: (rating - R) * poss / the season's possessions per team, R the league's replacement level (REPLACEMENT_LEVEL; NBA -1.98, WNBA -3.18 per 100). On that scale a season of possessions at R + 1 is a VORP of 1.
warFloat64Wins above replacement: (rating - R) * poss / 100 / points per win (PTS_PER_WIN; NBA 31.56, WNBA 31.31). 0 at replacement level; a season's war adds up to the league's wins minus a team of replacement players' (.189 NBA 2024-25, .104 WNBA 2025).
war_loFloat64Low end of the nominal 90% interval for war (5th percentile of 1000 bootstrap replicates, each team-season seeded on its own): each team-season's games resampled with replacement (a game's player possessions, team possessions and margin move together), then his possessions, the team net rating, the anchoring and the centring recomputed. The source ratings and the replacement level are held fixed, so this is the sampling uncertainty of the team side and the playing time; the war_bpm / war_rapm / war_boban spread is the source uncertainty.
war_hiFloat64High end of the nominal 90% interval for war (95th percentile of the same 1000 game-resampled replicates as war_lo).
war_bpmFloat64war from rating_bpm alone. Every source shares the league's replacement level, so war_bpm, war_rapm and war_boban add up to the same league total.
war_rapmFloat64war from rating_rapm alone.
war_bobanFloat64war from rating_boban alone. BOBAN shrinks low-minute players toward average, so the replacement pool carries more war_boban than war_bpm (the replacement level is a box-score level).
vorp_rankFloat64Rank of vorp within the season among every player (1 = most; ties average); null under 10 players.
war_rankFloat64Rank of war within the season among every player (1 = most; ties average); null under 10 players.
vorp_pctFloat64Percentile of vorp within the season: 100 * (n + 1 - rank) / (n + 1), n the players ranked; null when the rank is null.
war_pctFloat64Percentile of war within the season: 100 * (n + 1 - rank) / (n + 1), n the players ranked; null when the rank is null.
vorp_nInt64Sample size of vorp: on-court possessions, rounded.
war_nInt64Sample size of war: on-court possessions, rounded.
war_tierStringDepth-ladder tier by WAR percentile within the season's tier cohort, the players with on-court possessions of at least a tenth of the season's possessions per team (TIER_MIN_POSS_SHARE): Star (95 or more), Starter (80 to under 95), Rotation (50 to under 80), Bench (20 to under 50), Fringe (under 20), about the top 5%, then 15%, 30%, 30% and 20%, to within a player at each floor. The percentile is 100 * (n + 1 - rank) / (n + 1) among the cohort, not war_pct. Null under the possession floor (a call-up who barely played) and in a season whose cohort is under ten players.
pts_pgFloat64Points per game he played (minutes over 0), from the regular-season stats game logs.
reb_pgFloat64Rebounds per game he played (minutes over 0), from the regular-season stats game logs.
ast_pgFloat64Assists per game he played (minutes over 0), from the regular-season stats game logs.
pts_pg_rankFloat64Rank of pts_pg among the season's players with at least the games gate (1 game); 1 = most, ties averaged. Null under ten ranked players.
reb_pg_rankFloat64Rank of reb_pg among the season's players with at least the games gate (1 game); 1 = most, ties averaged. Null under ten ranked players.
ast_pg_rankFloat64Rank of ast_pg among the season's players with at least the games gate (1 game); 1 = most, ties averaged. Null under ten ranked players.
pts_pg_pctFloat64Percentile of pts_pg_rank: 100 * (n + 1 - rank) / (n + 1), n the ranked players.
reb_pg_pctFloat64Percentile of reb_pg_rank: 100 * (n + 1 - rank) / (n + 1), n the ranked players.
ast_pg_pctFloat64Percentile of ast_pg_rank: 100 * (n + 1 - rank) / (n + 1), n the ranked players.
pts_pg_nInt64Games behind pts_pg: the games he played (0 with no box line).
reb_pg_nInt64Games behind reb_pg: the games he played (0 with no box line).
ast_pg_nInt64Games behind ast_pg: the games he played (0 with no box line).

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10" (checked before any data is loaded).

Example

from sportsdataverse.nba.nba_player_war import nba_player_war
war = nba_player_war(2026)
war.select("player_name", "poss", "rating", "vorp", "war").head(10)

# WNBA via ``league_id``

wnba = nba_player_war(2025, league_id="10")

nba_player_wowy​

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

WOWY pairs: a team's season with two teammates together, apart and both off, per pair.

The definitions are in sportsdataverse._common.player_on_off.

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, team_id, player_id_a, player_id_b) (player_id_a the smaller id) for every pair of the team's players: for _both (together), _a_only, _b_only and _neither the minutes, poss / opp_poss, pts / opp_pts, plus_minus and off_rtg / def_rtg / net_rtg. The four splits' totals add up to the team's season; the ratings do not add. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
team_idInt64stats.nba.com team id.
player_id_aInt64The first player of the pair, the smaller id.
player_id_bInt64The second player of the pair, the larger id.
minutes_bothFloat64Game-clock minutes of the team's season with both A and B on the floor.
poss_bothInt64The team's offensive possessions with both A and B on the floor (a possession belongs to the five on the floor when it starts).
opp_poss_bothInt64The team's defensive possessions with both A and B on the floor.
pts_bothInt64The team's points with both A and B 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_bothInt64The opponent's points with both A and B on the floor, credited as pts_both is.
plus_minus_bothInt64pts_both - opp_pts_both.
off_rtg_bothFloat64Offensive rating with both A and B on the floor: pts_both per 100 poss_both; null with no possessions.
def_rtg_bothFloat64Defensive rating with both A and B on the floor: opp_pts_both per 100 opp_poss_both; null with no possessions.
net_rtg_bothFloat64Net rating with both A and B on the floor: off_rtg_both - def_rtg_both; null when either is null.
minutes_a_onlyFloat64Game-clock minutes of the team's season with A on the floor and B off.
poss_a_onlyInt64The team's offensive possessions with A on the floor and B off (a possession belongs to the five on the floor when it starts).
opp_poss_a_onlyInt64The team's defensive possessions with A on the floor and B off.
pts_a_onlyInt64The team's points with A on the floor and B off, each scoring action credited to the lineup at that action (a free throw to the lineup at the last foul).
opp_pts_a_onlyInt64The opponent's points with A on the floor and B off, credited as pts_a_only is.
plus_minus_a_onlyInt64pts_a_only - opp_pts_a_only.
off_rtg_a_onlyFloat64Offensive rating with A on the floor and B off: pts_a_only per 100 poss_a_only; null with no possessions.
def_rtg_a_onlyFloat64Defensive rating with A on the floor and B off: opp_pts_a_only per 100 opp_poss_a_only; null with no possessions.
net_rtg_a_onlyFloat64Net rating with A on the floor and B off: off_rtg_a_only - def_rtg_a_only; null when either is null.
minutes_b_onlyFloat64Game-clock minutes of the team's season with B on the floor and A off.
poss_b_onlyInt64The team's offensive possessions with B on the floor and A off (a possession belongs to the five on the floor when it starts).
opp_poss_b_onlyInt64The team's defensive possessions with B on the floor and A off.
pts_b_onlyInt64The team's points with B on the floor and A off, each scoring action credited to the lineup at that action (a free throw to the lineup at the last foul).
opp_pts_b_onlyInt64The opponent's points with B on the floor and A off, credited as pts_b_only is.
plus_minus_b_onlyInt64pts_b_only - opp_pts_b_only.
off_rtg_b_onlyFloat64Offensive rating with B on the floor and A off: pts_b_only per 100 poss_b_only; null with no possessions.
def_rtg_b_onlyFloat64Defensive rating with B on the floor and A off: opp_pts_b_only per 100 opp_poss_b_only; null with no possessions.
net_rtg_b_onlyFloat64Net rating with B on the floor and A off: off_rtg_b_only - def_rtg_b_only; null when either is null.
minutes_neitherFloat64Game-clock minutes of the team's season with neither A nor B on the floor.
poss_neitherInt64The team's offensive possessions with neither A nor B on the floor (a possession belongs to the five on the floor when it starts).
opp_poss_neitherInt64The team's defensive possessions with neither A nor B on the floor.
pts_neitherInt64The team's points with neither A nor B 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_neitherInt64The opponent's points with neither A nor B on the floor, credited as pts_neither is.
plus_minus_neitherInt64pts_neither - opp_pts_neither.
off_rtg_neitherFloat64Offensive rating with neither A nor B on the floor: pts_neither per 100 poss_neither; null with no possessions.
def_rtg_neitherFloat64Defensive rating with neither A nor B on the floor: opp_pts_neither per 100 opp_poss_neither; null with no possessions.
net_rtg_neitherFloat64Net rating with neither A nor B on the floor: off_rtg_neither - def_rtg_neither; null when either is null.

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_player_on_off import nba_player_wowy
pairs = nba_player_wowy(2025)
pairs.filter(team_id=1610612738).head()

nba_playoff_series​

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

Every postseason game keyed to its series, with the series score after it.

A series is every postseason game between one pair of teams in a season; play-in games are not a series. series_id is "{season}-{lower ESPN team id}-{higher}". team_a is game 1's home team. A series is decided once its leader has the wins to clinch (NBA: four, every round since 2003; WNBA: the Finals only, two through 2004, three 2005-2024, four from 2025) or plays a later series that postseason.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2025 is 2024-25). 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 postseason game (ESPN season_type 3): season, series_id, round (1 = first round .. 4 = Finals, from ESPN's type_abbreviation; null where ESPN gives none), round_code, round_name (the game headline without "Game N"), game_number (the headline's "Game N"; tip-off order in a series with a headline lacking one), game_id, game_date, completed, the home and away team_id / abbreviation / display_name / score, winner_team_id (null until final), team_a_id, team_b_id, team_a_wins / team_b_wins (the series score after this game), and on every row of the series series_games, decided and series_winner_team_id (null until decided): the series' outcome as of the release, not as of that game, so they leak the result into an earlier game's row. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (2025 is 2024-25; the WNBA season is its calendar year).
series_idStringSeries key: '{season}-{lower ESPN team id}-{higher ESPN team id}'. A pair of teams meets at most once per postseason, so the pair is the series.
roundInt64Round number from ESPN's type_abbreviation: 1 first round, 2 second round (NBA conference semifinals), 3 semifinals (NBA conference finals), 4 Finals; null where ESPN gives no round (older seasons).
round_codeStringESPN's type_abbreviation for the round (RD16, QTR, SEMI, FINAL); null where it carries none.
round_nameStringThe round as ESPN's game headline names it, without its 'Game N' (the latest game's headline in the series).
game_numberInt64Game number within the series: the "Game N" of the ESPN headline, so a game missing from the release leaves a gap; tip-off order for the whole series when one of its headlines has no number.
game_idInt64ESPN game id of the series game (joins the ESPN schedule, summary and box score).
game_dateStringGame date (US).
completedBooleanTrue when the game is final.
home_team_idInt64Home team's ESPN team id.
home_abbreviationStringHome team's abbreviation.
home_display_nameStringHome team's display name.
home_scoreInt64Home points (null before tip-off).
away_team_idInt64Away team's ESPN team id.
away_abbreviationStringAway team's abbreviation.
away_display_nameStringAway team's display name.
away_scoreInt64Away points (null before tip-off).
winner_team_idInt64The game winner's ESPN team id; null until the game is final.
team_a_idInt64ESPN team id of game 1's home team (the side with home court).
team_b_idInt64ESPN team id of the other side.
team_a_winsInt64team_a's series wins after this game (finals up to and including it).
team_b_winsInt64team_b's series wins after this game.
series_gamesInt64Games listed in the series so far (played and scheduled); the same on every row of the series.
decidedBooleanTrue once the series leader has the wins to clinch (NBA: four, every round since 2003; WNBA: the Finals only, two through 2004, three 2005-2024, four from 2025) or plays a later series that postseason. The final outcome as of the release, repeated on every row of the series, not as of that game: an earlier game's row already shows it, so never use it as a feature for that game.
series_winner_team_idInt64The series winner's ESPN team id; null until decided. The final outcome as of the release, repeated on every row of the series, not as of that game: an earlier game's row already shows it, so never use it as a feature for that game.

Raises

ExceptionDescription
ValueErrorIf league_id is not "00" or "10" (checked before any load).

Example

from sportsdataverse.nba.nba_playoff_series import nba_playoff_series
games = nba_playoff_series(2025)
games.filter(games["round"] == 4).select("game_number", "home_score", "away_score", "team_a_wins", "team_b_wins")

nba_playoff_series_players​

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

Each player's totals and per-game line in each playoff series, against the player's regular season.

Parameters

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

Returns

One row per player who played (minutes above zero) in a final game of the series, keyed (season, series_id, team_id, athlete_id) with athlete_display_name: games, min and the summed counts as nba_playoff_series_teams; <stat>_pg per game for min, pts, reb, ast, stl, blk, tov and fg3m, plus ts_pct (PTS / (2 * (FGA + 0.44 * FTA))); reg_games and reg_<stat>_pg / reg_ts_pct over the player's regular season (every team played for; null with none); and <stat>_pg_diff / ts_pct_diff, series minus regular season.

col_nametypedescription
seasonInt64Season, named by the year it ends (2025 is 2024-25; the WNBA season is its calendar year).
series_idStringSeries key: '{season}-{lower ESPN team id}-{higher ESPN team id}'. A pair of teams meets at most once per postseason, so the pair is the series.
team_idInt64ESPN team id of the player's team in the series.
athlete_idInt64ESPN athlete id (joins the ESPN rosters and player box scores).
athlete_display_nameStringThe player's name.
gamesInt64Series games played (not marked did-not-play, with minutes or any box count).
minFloat64Total minutes in the series.
ptsInt64Total points in the series: the sum of the player's ESPN game boxes.
fgmInt64Total field goals made in the series: the sum of the player's ESPN game boxes.
fgaInt64Total field goals attempted in the series: the sum of the player's ESPN game boxes.
fg3mInt64Total three-pointers made in the series: the sum of the player's ESPN game boxes.
fg3aInt64Total three-pointers attempted in the series: the sum of the player's ESPN game boxes.
ftmInt64Total free throws made in the series: the sum of the player's ESPN game boxes.
ftaInt64Total free throws attempted in the series: the sum of the player's ESPN game boxes.
orebInt64Total offensive rebounds in the series: the sum of the player's ESPN game boxes.
drebInt64Total defensive rebounds in the series: the sum of the player's ESPN game boxes.
rebInt64Total rebounds in the series: the sum of the player's ESPN game boxes.
astInt64Total assists in the series: the sum of the player's ESPN game boxes.
stlInt64Total steals in the series: the sum of the player's ESPN game boxes.
blkInt64Total blocks in the series: the sum of the player's ESPN game boxes.
tovInt64Total turnovers in the series: the sum of the player's ESPN game boxes.
pfInt64Total personal fouls in the series: the sum of the player's ESPN game boxes.
min_pgFloat64Minutes per series game played.
pts_pgFloat64Points per series game played.
reb_pgFloat64Total rebounds per series game played.
ast_pgFloat64Assists per series game played.
stl_pgFloat64Steals per series game played.
blk_pgFloat64Blocks per series game played.
tov_pgFloat64Turnovers per series game played.
fg3m_pgFloat64Three-pointers made per series game played.
ts_pctFloat64True shooting in the series: PTS / (2 * (FGA + 0.44 * FTA)); null with no attempts.
reg_gamesInt64Regular-season games played (every team the player played for that season); null with none.
reg_min_pgFloat64Minutes per regular-season game played.
reg_pts_pgFloat64Points per regular-season game played.
reg_reb_pgFloat64Total rebounds per regular-season game played.
reg_ast_pgFloat64Assists per regular-season game played.
reg_stl_pgFloat64Steals per regular-season game played.
reg_blk_pgFloat64Blocks per regular-season game played.
reg_tov_pgFloat64Turnovers per regular-season game played.
reg_fg3m_pgFloat64Three-pointers made per regular-season game played.
reg_ts_pctFloat64True shooting over the player's regular season.
min_pg_diffFloat64min_pg - reg_min_pg: the series against the player's regular season (positive is up).
pts_pg_diffFloat64pts_pg - reg_pts_pg: the series against the player's regular season (positive is up).
reb_pg_diffFloat64reb_pg - reg_reb_pg: the series against the player's regular season (positive is up).
ast_pg_diffFloat64ast_pg - reg_ast_pg: the series against the player's regular season (positive is up).
stl_pg_diffFloat64stl_pg - reg_stl_pg: the series against the player's regular season (positive is up).
blk_pg_diffFloat64blk_pg - reg_blk_pg: the series against the player's regular season (positive is up).
tov_pg_diffFloat64tov_pg - reg_tov_pg: the series against the player's regular season (positive is up).
fg3m_pg_diffFloat64fg3m_pg - reg_fg3m_pg: the series against the player's regular season (positive is up).
ts_pct_diffFloat64ts_pct - reg_ts_pct.

Raises

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

Example

from sportsdataverse.nba.nba_playoff_series import nba_playoff_series_players
p = nba_playoff_series_players(2025)
p.filter(p["series_id"] == "2025-11-25").sort("pts_pg_diff", descending=True).head()

nba_playoff_series_teams​

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

Each team's record and box totals in each playoff series: the sum of its game boxes.

Parameters

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

Returns

Two rows per series with a final game, keyed (season, series_id, team_id) with opponent_team_id and team_abbreviation: games, wins, losses, pts, opp_pts and the summed counts fgm, fga, fg3m, fg3a, ftm, fta, oreb, dreb, reb, ast, stl, blk, tov, pf over the series' final games.

col_nametypedescription
seasonInt64Season, named by the year it ends (2025 is 2024-25; the WNBA season is its calendar year).
series_idStringSeries key: '{season}-{lower ESPN team id}-{higher ESPN team id}'. A pair of teams meets at most once per postseason, so the pair is the series.
team_idInt64ESPN team id of the row's team (joins the ESPN schedule and team box scores).
opponent_team_idInt64The opponent's ESPN team id.
team_abbreviationStringTeam abbreviation.
gamesInt64Final games in the series.
winsInt64Games the team won in the series, counting its final games only.
lossesInt64Games the team lost in the series, counting its final games only.
opp_ptsInt64Opponent points over the series' final games.
ptsInt64Total points over the series' final games: the sum of the team's ESPN game boxes.
fgmInt64Total field goals made over the series' final games: the sum of the team's ESPN game boxes.
fgaInt64Total field goals attempted over the series' final games: the sum of the team's ESPN game boxes.
fg3mInt64Total three-pointers made over the series' final games: the sum of the team's ESPN game boxes.
fg3aInt64Total three-pointers attempted over the series' final games: the sum of the team's ESPN game boxes.
ftmInt64Total free throws made over the series' final games: the sum of the team's ESPN game boxes.
ftaInt64Total free throws attempted over the series' final games: the sum of the team's ESPN game boxes.
orebInt64Total offensive rebounds over the series' final games: the sum of the team's ESPN game boxes.
drebInt64Total defensive rebounds over the series' final games: the sum of the team's ESPN game boxes.
rebInt64Total rebounds over the series' final games: the sum of the team's ESPN game boxes.
astInt64Total assists over the series' final games: the sum of the team's ESPN game boxes.
stlInt64Total steals over the series' final games: the sum of the team's ESPN game boxes.
blkInt64Total blocks over the series' final games: the sum of the team's ESPN game boxes.
tovInt64Total turnovers over the series' final games: the sum of the team's ESPN game boxes.
pfInt64Total personal fouls over the series' final games: the sum of the team's ESPN game boxes.

Raises

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

Example

from sportsdataverse.nba.nba_playoff_series import nba_playoff_series_teams
nba_playoff_series_teams(2025).sort("pts", descending=True).head()

nba_playtype_ratings​

nba_playtype_ratings(season: 'str', *, league_id: 'str' = '00', off_team: 'Optional[pl.DataFrame]' = None, def_team: 'Optional[pl.DataFrame]' = None, schedule: 'Optional[pl.DataFrame]' = None, return_as_pandas: 'bool' = False) -> 'Union[pl.DataFrame, pd.DataFrame]'

Season play-type-adjusted offensive/defensive team ratings.

Fetches (or uses injected) Synergy offensive/defensive team frames plus the league schedule, computes raw per-type efficiency (raw_playtype_efficiency), opponent-adjusts it (adjust_playtype_efficiency), then rolls up to one row per team.

Parameters

ParameterTypeDefaultDescription
seasonstrSeason string, e.g. "2023-24".
league_idstr'00'"00" NBA (default), "10" WNBA, "20" G-League.
off_teamOptional[DataFrame]NoneInjected Synergy offensive team frame (bypasses the live fetch -- used for tests / oracle fixtures).
def_teamOptional[DataFrame]NoneInjected Synergy defensive team frame.
scheduleOptional[DataFrame]NoneInjected team_id/opp_team_id schedule frame.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per team: team_id (Int64), adj_off/adj_def/adj_net (Float64) roll-ups, plus per-type wide columns adj_off_ppp_<playtype>/adj_def_ppp_<playtype>/off_freq_<playtype> (Float64) for each play type present in the data. adj_off = Σ_t off_freq_t · adj_off_ppp_t · 100 (symmetric for adj_def off def_freq_t); adj_net = adj_off - adj_def. Returns a zero-row frame with the base roll-up schema when the upstream fetch is 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_playtype_ratings
r = nba_playtype_ratings("2023-24")
print(r.sort("adj_off", descending=True).head(10))

# Injected offline (oracle / test) path

r = nba_playtype_ratings("2023-24", off_team=off_df, def_team=def_df, schedule=sched_df)

# Pipeline next step

r.filter(pl.col("adj_net") > 0).sort("adj_net", descending=True)

nba_possession_rate_rows​

nba_possession_rate_rows(possessions: 'pl.DataFrame', schedule: 'pl.DataFrame', *, league_id: 'str' = '00', season_type: 'str' = 'regular-season') -> 'pl.DataFrame'

Map nba_stats_possessions rows onto the team-season-rates possession frame.

Keeps the games of schedule whose season_type matches, takes the home team from the schedule, and sets each possession's start clock to the previous possession's end clock in the period (the period length for the first one). Points come from the made-shot counts. A game whose first period runs past 15 minutes is played in two 20-minute halves (the WNBA through 2005): its periods are 20 minutes, late starts with the 2nd half and period 3 is overtime.

neutral_site comes from sportsdataverse.nba.nba_neutral_site: the 2020 bubbles and the curated games abroad and NBA Cup knockout games in Las Vegas, by stats game_id. The stats schedule has no neutral-site or venue column, and ESPN's neutral_site misses most of them (it marks the 2023-24 Cup semifinals False).

Parameters

ParameterTypeDefaultDescription
possessionsDataFrameload_nba_stats_possessions / load_wnba_stats_possessions rows.
scheduleDataFrameload_nba_stats_schedules / load_wnba_stats_schedules rows (game_id, season_type, home_team_id).
league_idstr'00'"00" NBA (12-minute quarters) or "10" WNBA (10-minute quarters).
season_typestr'regular-season'The schedule season_type to keep: "regular-season" (the default, stats.nba.com's "Regular Season"; NBA Cup group and knockout games count, the Cup final does not), "preseason", "playoffs" or "play-in".

Returns

One row per possession in ~sportsdataverse._common.team_season_rates.RATE_ROWS_SCHEMA.

col_nametypedescription
seasonInt64Season, named by the year it ends.
game_idStringstats.nba.com game id.
periodInt64Period of the possession; overtimes follow the last regulation period.
possession_numberInt64Order of the possession in the game.
lateBooleanTrue in the last regulation period (the 4th quarter; the 2nd half of a two-halves game) or an overtime: the periods the clutch window can fall in.
start_clockFloat64Seconds left in the period when the possession starts (when the previous possession ended).
end_clockFloat64Seconds left in the period when the possession ends.
offense_team_idInt64stats.nba.com id of the team with the ball.
defense_team_idInt64stats.nba.com id of the team on defense.
offense_is_homeBooleanTrue when the offense is the (nominal) home team; it signs the running score for the clutch margin.
neutral_siteBooleanAlways False: the schedule names a home team for every NBA and WNBA game.
pointsInt64Points the offense scored on the possession, from its made shots and free throws (2 * fg2m + 3 * fg3m + ftm).
fgaFloat64Offense field-goal attempts on the possession.
fgmFloat64Offense field goals made on the possession.
fg3mFloat64Offense three-pointers made on the possession.
ftaFloat64Offense free-throw attempts on the possession.
ftmFloat64Offense free throws made on the possession.
orebFloat64Offense offensive rebounds on the possession.
drebFloat64Defense defensive rebounds on the possession (the other half of the offensive-rebound chances).
tovFloat64Offense turnovers on the possession.
ff_possFloat64Turnover-rate denominator: 1 per possession.

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_loaders import load_nba_stats_possessions, load_nba_stats_schedules
from sportsdataverse.nba.nba_team_season_rates import nba_possession_rate_rows
rows = nba_possession_rate_rows(load_nba_stats_possessions(2025), load_nba_stats_schedules(2025))

nba_pregame_projections​

nba_pregame_projections(season: 'int', *, league_id: 'str' = '00', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Rated pregame projection for every ESPN game of an NBA / WNBA season, as of each game's date.

The number the game page's pregame card prints: the closed form on each team's team_strength before the game; see the module docstring for the model and the as-of boundary.

Parameters

ParameterTypeDefaultDescription
seasonintThe season, 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 game of the season in the ESPN schedule release (scheduled games included; a row the release labels with another season is dropped): season, game_id, game_date, as_of_date (the ratings use regular-season possessions dated strictly before it), home_team_id / away_team_id (ESPN ids, Int32), neutral_site, stats_game_id, each side's rating (adj_net_rtg, per 100), rank (adj_net_rtg_rank), games and pace, hfa (points, 0 at a neutral site), exp_home_margin (points) and rated_home_prob. The ratings and prediction are null for a game with no stats match or a side with no rating yet. Then the in-game WP prior (BB-D25, see the module docstring): wp_prior_home_rating / wp_prior_away_rating (per 100) and their ranks, wp_prior_poss, wp_prior_hfa (points, 0 at a neutral site), wp_prior_margin_sd, wp_prior_exp_home_margin and wp_prior_home_prob; null for a game with no stats match. The ranks are also null before any team is rated (opening day of a season with no prior season released).

col_nametypedescription
seasonInt32Season, named by the year it ends (2027 is 2026-27; the WNBA season is its calendar year).
game_idInt32ESPN game id (Int32).
game_dateDateGame date (ESPN schedule).
as_of_dateDateThe ratings use the completed games dated strictly before this date: the game's date, or the day after the last completed game for a game not yet reached.
home_team_idInt32ESPN home team id (Int32).
away_team_idInt32ESPN away team id (Int32).
neutral_siteBooleanNeutral-site flag; a neutral game gets no home term.
stats_game_idStringThe stats.nba.com / stats.wnba.com game id matched on date and team names; null for a game with no match (All-Star games, the WNBA Commissioner's Cup final).
home_ratingFloat64Home team's team_strength adj_net_rtg before the game: the possession ridge over the regular-season possessions dated before as_of_date, points per 100 over an average opponent on a neutral court.
away_ratingFloat64Away team's adj_net_rtg before the game, on the same basis.
home_rankFloat64Home team's adj_net_rtg_rank as of the date (team_strength's rank: 1 = best, among teams with at least half the most games).
away_rankFloat64Away team's adj_net_rtg_rank as of the date.
home_gamesInt64Home team's regular-season games behind its rating.
away_gamesInt64Away team's games behind its rating.
home_paceFloat64Home team's team_strength pace (possessions per 48 minutes NBA, 40 WNBA) as of the date.
away_paceFloat64Away team's pace as of the date.
hfaFloat64Home-court term in points (the league's fitted hfa: 2.184 NBA, 1.184 WNBA), 0 at a neutral site.
exp_home_marginFloat64Expected home margin in points, the producer's closed form on the two ratings (positive favours the home team).
rated_home_probFloat64Pregame home win probability, Phi(exp_home_margin / margin_sd) with the league's fitted margin_sd; null when a side has no rating.
wp_prior_home_ratingFloat64In-game WP prior (BB-D25, nba_rated_priors): the home team's adj_net_rtg in the season sim's game model before the game, points per 100, shrunk toward last season's regressed rating (0 = average, which an unrated team is).
wp_prior_away_ratingFloat64In-game WP prior: the away team's game-model adj_net_rtg before the game, on the same basis.
wp_prior_home_rankFloat64Home team's rank by wp_prior_home_rating among the game model's teams as of the date (1 = best; tied teams share the better, smaller rank); null before any team is rated (opening day with no prior season).
wp_prior_away_rankFloat64Away team's rank by wp_prior_away_rating as of the date.
wp_prior_possFloat64In-game WP prior: the game model's possessions per team per game as of the date (last season's before any game; 100 on opening day when no previous season is released).
wp_prior_hfaFloat64In-game WP prior: the game model's home term in points, 2 x its per-100 home term x wp_prior_poss / 100; 0 at a neutral site. It is refit every day, so it is noisy in a season's first days.
wp_prior_margin_sdFloat64In-game WP prior: the probit scale of a game's margin in points (the season sim's).
wp_prior_exp_home_marginFloat64In-game WP prior's expected home margin in points: (wp_prior_home_rating - wp_prior_away_rating) x wp_prior_poss / 100 + wp_prior_hfa.
wp_prior_home_probFloat64The pregame home win probability the in-game win-probability booster starts from when there is no line (BB-D25): Phi(wp_prior_exp_home_margin / wp_prior_margin_sd). Null only for a game with no stats match.

Raises

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

Example

from sportsdataverse.nba.nba_pregame_projection import nba_pregame_projections
out = nba_pregame_projections(2026)
out.select("game_id", "game_date", "exp_home_margin", "rated_home_prob").head()

# WNBA

nba_pregame_projections(2025, league_id="10")

nba_rated_priors​

nba_rated_priors(season: 'int', *, league_id: 'str' = '00', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

Rated pregame home win probability for every ESPN game of a season, as of each game's date.

The in-game win-probability prior when a game has no betting line (~sportsdataverse.nba.nba_game_page.home_prior's rated_home_prob); see the module docstring for the model and the as-of boundary.

Parameters

ParameterTypeDefaultDescription
seasonintThe season, 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 game of the season in the ESPN schedule release (scheduled games included; a row the release labels with another season is dropped): season, game_id, game_date, home_team_id, away_team_id (ESPN ids, Int32, as in the pbp release), neutral_site, stats_game_id, the two teams' adjusted net ratings before the game (home_adj_net_rtg, away_adj_net_rtg, per 100), the home term hfa (per 100, applied to both offenses), exp_home_margin (points) and rated_home_prob. The last six are null for a game with no stats.nba.com match (All-Star games and the WNBA Commissioner's Cup final).

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
game_idInt64ESPN game id (Int32, as in the pbp release).
game_dateDateGame date (ESPN schedule); the ratings use the games dated strictly before it.
home_team_idInt64ESPN home team id.
away_team_idInt64ESPN away team id.
neutral_siteBooleanESPN's neutral-site flag; a neutral game gets no home term.
stats_game_idStringThe stats.nba.com / stats.wnba.com game id matched on date and team names; null for a game with no match (All-Star games).
home_adj_net_rtgFloat64Home team's adjusted net rating before the game, points per 100 over an average opponent on a neutral court (the season sim's as-of possession ridge, shrunk toward last season's regressed rating).
away_adj_net_rtgFloat64Away team's adjusted net rating before the game, points per 100, on the same basis.
hfaFloat64The as-of ridge's home term, points per 100 for the home offense over a neutral court (applied to both offenses).
exp_home_marginFloat64Expected home margin in points: (home_adj_net_rtg - away_adj_net_rtg + 2 * hfa) * possessions per game / 100, without the home term at a neutral site.
rated_home_probFloat64Rated pregame home win probability: Phi(exp_home_margin / margin_sd) with the season sim's probit scale. Pass it to score_win_prob / game_page_tables as rated_home_prob to make it the prior of a game with no line; without it that game gets home-court advantage (0.5 at a neutral site).

Raises

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

Example

from sportsdataverse.nba.nba_rated_prior import nba_rated_priors
priors = nba_rated_priors(2026)
priors.select("game_id", "game_date", "exp_home_margin", "rated_home_prob").head()

# WNBA

nba_rated_priors(2025, league_id="10")

nba_ratings_panel​

nba_ratings_panel(model: 'AnyModel', possessions: 'pl.DataFrame', dates: 'Optional[Sequence[datetime.date]]' = None, *, return_as_pandas: 'bool' = False) -> 'Union[pl.DataFrame, pd.DataFrame]'

Player-ratings-through-date long panel: one row per (player_id, date).

Refit-per-checkpoint (v1; no warm-start incrementality) — each date's row calls ratings_as_of independently, so the panel is leakage-free by construction: a possession dated after a given checkpoint can never affect that checkpoint's row, no matter what other dates are also being computed or what future rows exist in possessions. Cost is a full refit per checkpoint date; for a season's sparse RAPM-family design this is seconds per date, not minutes — acceptable for a nightly/daily cadence but not for live in-game updating (out of scope; see spec non-goals).

Parameters

ParameterTypeDefaultDescription
modelAnyModelA harness model conforming to nba_model_validation.AnyModel.
possessionsDataFrameA possession+lineup frame with a game_date (pl.Date) column (as emitted by compile_nba_season).
datesOptional[Sequence[date]]NoneCheckpoint dates to compute. None (default) uses every distinct game_date present in possessions, sorted ascending — a rating for every game day, matching what EPM/LEBRON publish nightly. Duplicates are deduped; input order does not matter (the output is always sorted by date).
return_as_pandasboolFalseReturn pandas instead of polars.

Returns

Long frame with RATINGS_PANEL_SCHEMA columns (player_id, date, o_rating, d_rating, rating). Zero-row (that schema) when possessions is empty or no date yields any players.

No returns table is published for this function: no capture: its possessions input needs a game_date column, and neither nba_possessions nor the released possessions carry one.

Raises

ExceptionDescription
ValueErrorIf possessions (non-empty) lacks a game_date column.

Example

import datetime
from sportsdataverse.nba.nba_model_validation import RidgeRapmModel
from sportsdataverse.nba.nba_ratings_panel import nba_ratings_panel

checkpoints = [datetime.date(2023, 11, 1), datetime.date(2023, 12, 1)]
panel = nba_ratings_panel(RidgeRapmModel(), season_poss, dates=checkpoints)
print(panel.filter(pl.col("player_id") == 201939).sort("date"))

# Every game day, no explicit grid

panel = nba_ratings_panel(RidgeRapmModel(), season_poss)

nba_raw_store_season_frame​

nba_raw_store_season_frame(endpoint: 'str', season: 'int', variant: 'Optional[str]' = None, *, result_set: 'Optional[str]' = None, raw_store_dir: 'RawStoreDir' = None) -> "Optional['pl.DataFrame']"

Read a committed SEASON-LEVEL capture from the raw store, parsed to a frame.

The per-game half of the store is served by the read-through per-game path; this is the season-keyed half (leaguegamelog, playerindex, leaguedashplayerbiostats, ...) that the -raw scraper writes as

  • {endpoint}/{season}/{variant}.json -- parameterized captures, where variant is the slugified parameter sweep (e.g. "regular-season", "regular-season_totals"), and
  • {endpoint}/{season}.json -- unparameterized captures (e.g. playerindex), i.e. variant=None.

Roots may be a local checkout or an http(s):// base (the raw repo served over raw.githubusercontent / a CDN), so a consumer -- notably the hoopR-nba-stats-data model producer -- runs clone-free in CI against the same committed tree the per-game compile reads.

Parameters

ParameterTypeDefaultDescription
endpointstrstats.nba.com endpoint slug (the store subdirectory).
seasonintSeason END year (2024 = 2023-24) -- the key both halves of the store are filed under.
variantOptional[str]NoneCapture variant slug, or None for an unparameterized capture.
result_setOptional[str]NoneNamed result set to return when the payload carries several; defaults to the first frame that parses.
raw_store_dirRawStoreDirNoneStore root spec (dir or URL base) or per-endpoint mapping; None falls back to the env vars, "" disables.

Returns

The parsed polars.DataFrame, or None when the store is unset, the capture is absent, or the payload carries no usable frame -- so a caller can cleanly fall back to a live fetch.

col_nametypedescription
season_idStringUnique season identifier.
team_idInt64Unique team identifier.
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_nameStringFull team display name (e.g. 'Las Vegas Aces').
game_idStringUnique game identifier.
game_dateStringGame date (YYYY-MM-DD).
matchupStringMatchup.
wlStringWl.
minInt64Minutes played.
fgmInt64Field goals made.
fgaInt64Field goal attempts.
fg_pctFloat64Field goal percentage (0-1).
fg3_mInt64Three-point field goals made.
fg3_aInt64Three-point field goal attempts.
fg3_pctFloat64Three-point field goal percentage (0-1).
ftmInt64Free throws made.
ftaInt64Free throw attempts.
ft_pctFloat64Free throw percentage (0-1).
orebInt64Offensive rebounds.
drebInt64Defensive rebounds.
rebInt64Rebounds per game.
astInt64Assists.
stlInt64Steals.
blkInt64Blocks.
tovInt64Turnovers.
pfInt64Personal fouls.
ptsInt64Points scored.
plus_minusInt64Plus/minus point differential while on court.
video_availableInt64Video available.

Example

from sportsdataverse.nba import nba_raw_store_season_frame
base = "https://raw.githubusercontent.com/sportsdataverse/hoopR-nba-stats-raw/main/nba_stats/json"
logs = nba_raw_store_season_frame("leaguegamelog", 2024, "regular-season", raw_store_dir=base)

# Fall back to a live fetch when the capture is absent

frame = nba_raw_store_season_frame("playerindex", 2024, raw_store_dir=base)
positions = frame if frame is not None else nba_stats_playerindex(season="2023-24")