WNBA — additional Python functions — Analytics: make_prob–wnba_game
make_prob_by_context
make_prob_by_context(ptshots: 'pl.DataFrame', *, return_as_pandas: 'bool' = False) -> "'dict[str, Union[pl.DataFrame, pd.DataFrame]]'"
Marginal FG% tables by defender distance and by shot clock.
The public API exposes defender-distance and shot-clock only as aggregate
bucket tables (playerdashptshots), not per-shot fields, so this
aggregates Σfgm/Σfga across players within each bucket.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ptshots | DataFrame | The stacked playerdashptshots fixture — one frame with a result_set tag (ClosestDefenderShooting / ShotClockShooting) plus bucket, fga, fgm. | |
return_as_pandas | bool | False | Return pandas DataFrames instead of polars. |
Returns
{"defender": frame, "shot_clock": frame} each with rows per bucket (bucket, fga, fgm, fg_pct). Missing result sets return the zero-row schema.
Example
from sportsdataverse.nba.nba_shot_value import make_prob_by_context
tables = make_prob_by_context(ptshots)
tables["defender"].sort("fg_pct")
make_prob_joint
make_prob_joint(defender: 'pl.DataFrame', shot_clock: 'pl.DataFrame', overall_fg_pct: 'float', *, return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"
Independence-combined defender x shot-clock make probability.
Combines the two marginal FG% tables under a conditional-independence
assumption via odds multipliers: odds(p) = p/(1-p);
odds_joint = odds_overall * (odds_def/odds_overall) * (odds_clock/odds_overall); joint = odds_joint/(1+odds_joint). This
assumes defender distance and shot-clock effects are independent given the
league baseline — a simplification (a late clock correlates with tighter
defense), documented here so callers weigh it.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
defender | DataFrame | The "defender" marginal table from make_prob_by_context (bucket, fg_pct). | |
shot_clock | DataFrame | The "shot_clock" marginal table (bucket, fg_pct). | |
overall_fg_pct | float | The league overall FG% baseline. | |
return_as_pandas | bool | False | Return a pandas DataFrame instead of polars. |
Returns
One row per (close_def_dist_range, shot_clock_range): close_def_dist_range:Utf8, shot_clock_range:Utf8, joint_fg_pct:Float64. Empty inputs return the zero-row schema.
No returns table is published for this function: no capture: its inputs come from make_prob_by_context on stats.nba.com tracking data, which answers HTTP 403 to the datacenter IP the docs are built on.
Example
from sportsdataverse.nba.nba_shot_value import make_prob_by_context, make_prob_joint
t = make_prob_by_context(ptshots)
joint = make_prob_joint(t["defender"], t["shot_clock"], 0.47)
score_shot_xpoints
score_shot_xpoints(shots: 'pl.DataFrame', league_avgs: 'pl.DataFrame', *, return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"
Score each shot with expected points from the league-average baseline.
Joins the per-shot frame to the zone baseline (falling back to the
within-shot_zone_range mean when a zone triple is unmatched) and adds
shot_value (3 for a 3PT shot else 2), xpoints = base_fg_pct * shot_value, and actual_points = shot_made_flag * shot_value.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
shots | DataFrame | Per-shot Shot_Chart_Detail frame (needs shot_type + the three zone keys + shot_made_flag). | |
league_avgs | DataFrame | The LeagueAverages frame (see xpoints_baseline). | |
return_as_pandas | bool | False | Return a pandas DataFrame instead of polars. |
Returns
The input shots plus shot_value:Int64, base_fg_pct:Float64, xpoints:Float64, actual_points:Float64. Empty input returns the augmented schema with zero rows.
No returns table is published for this function: no capture: its input is the shots frame of wnba_shot_value, which reads stats.nba.com shotchartdetail; that host answers HTTP 403 to the datacenter IP the docs are built on.
Raises
| Exception | Description |
|---|---|
ValueError | A zone join key has a different dtype on the two frames. |
Example
import polars as pl
from sportsdataverse.nba.nba_shot_value import score_shot_xpoints
scored = score_shot_xpoints(shots, league_avgs)
# Pipeline next step (one line)
scored.group_by("player_id").agg(pl.col("xpoints").sum())
shooter_talent
shooter_talent(scored_shots: 'pl.DataFrame', *, league_id: 'str' = '00', min_attempts: 'int' = 50, return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"
Regressed shooter true-talent: make%-above-expected, shrunk to the mean.
Aggregates score_shot_xpoints output per shooter and regresses the
raw over-expected rate toward zero by n/(n+k) (k = get_shrinkage_k(league_id), fitted split-half). As-of leakage
boundary: to score a shooter's talent for shots after date D, pass
only that shooter's shots before D -- this function does not enforce the
cut itself.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
scored_shots | DataFrame | score_shot_xpoints output (needs player_id, shot_made_flag, base_fg_pct, xpoints, actual_points). | |
league_id | str | '00' | "00" NBA, "10" WNBA, "20" G-League. |
min_attempts | int | 50 | Drop shooters with fewer attempts (unstable estimate). |
return_as_pandas | bool | False | Return a pandas DataFrame instead of polars. |
Returns
One row per player_id: player_id:Int64, n_att:Int64, actual_makes:Int64, exp_makes:Float64, points_above_expected:Float64, raw_above_pct:Float64, talent_pct:Float64. Empty input returns the zero-row schema.
No returns table is published for this function: no capture: its input is the shots frame of wnba_shot_value, which reads stats.nba.com shotchartdetail; that host answers HTTP 403 to the datacenter IP the docs are built on.
Example
from sportsdataverse.nba.nba_shot_value import score_shot_xpoints, shooter_talent
talent = shooter_talent(score_shot_xpoints(shots, league_avgs))
# Pipeline next step (one line)
talent.sort("talent_pct", descending=True).head(15)
shot_selection_quality
shot_selection_quality(scored_shots: 'pl.DataFrame', *, min_attempts: 'int' = 50, return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"
Player shot-selection quality: mean expected value vs the league mean.
xev_per_shot is a player's mean xpoints (the value of the LOOKS
they take, independent of makes); selection_quality is that minus the
league-wide mean xpoints over the same frame -- a rim-and-three diet
scores positive, a mid-range diet negative.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
scored_shots | DataFrame | score_shot_xpoints output (needs player_id, xpoints). | |
min_attempts | int | 50 | Drop players with fewer attempts. |
return_as_pandas | bool | False | Return a pandas DataFrame instead of polars. |
Returns
One row per player_id: player_id:Int64, n_att:Int64, xev_per_shot:Float64, league_xev_per_shot:Float64, selection_quality:Float64. Empty input returns the zero-row schema.
No returns table is published for this function: no capture: its input is the shots frame of wnba_shot_value, which reads stats.nba.com shotchartdetail; that host answers HTTP 403 to the datacenter IP the docs are built on.
Example
from sportsdataverse.nba.nba_shot_value import score_shot_xpoints, shot_selection_quality
sel = shot_selection_quality(score_shot_xpoints(shots, league_avgs))
# Pipeline next step (one line)
sel.sort("selection_quality", descending=True).head(15)
wnba_availability
wnba_availability(seasons: "'int | list[int]'", *, return_as_pandas: 'bool' = False) -> "'pl.DataFrame | pd.DataFrame'"
WNBA availability -- the NBA core bound to league="wnba".
See sportsdataverse.nba.nba_availability.nba_availability for the
full contract; avail_pct is availability, not skill.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | A season (start year) or list of seasons. | |
return_as_pandas | bool | False | Return a pandas DataFrame instead of polars. |
Returns
Frame player_id:Utf8, season:Int64, avail_pct:Float64.
No returns table is published for this function: no capture: it reads stats.wnba.com, which answers HTTP 403 to the datacenter IP the docs are built on; the function works from a residential IP.
Example
from sportsdataverse.wnba import wnba_availability
proj = wnba_availability(2023)
wnba_coach_careers
wnba_coach_careers(seasons: 'int | list[int]', *, league_id: 'str' = '10', season_type: 'str' = 'regular-season', espn: 'bool' = True, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA head-coach careers over the given seasons (league_id='10'). See sportsdataverse.nba.nba_coach_seasons.nba_coach_careers.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
season_type | str | 'regular-season' | |
espn | bool | True | |
return_as_pandas | bool | False |
Returns
One row per coach_id, most games first: teams (abbreviations, first to last), seasons, first_season, last_season, the summed record and counts and the recomputed rates, with ranks among coaches with at least a full season of games. To build careers from coach seasons already in hand, call ~sportsdataverse._common.coach_seasons.coach_careers on them.
| col_name | type | description |
|---|---|---|
coach_id | Int64 | stats.nba.com coach id of the head coach (nba_stats_coaches / wnba_stats_coaches). |
coach | String | Head coach's name (stats.nba.com's staff list). |
role | String | HC: head coach (the only role the table carries). |
teams | String | Teams coached, first to last, comma-joined (schools in college, abbreviations in the pros). |
seasons | Int64 | Distinct seasons in the career (only the seasons passed in). |
first_season | Int64 | First season in the career. |
last_season | Int64 | Last season in the career. |
games | Int64 | Games credited to the coach over the seasons passed in. |
wins | Int64 | Wins in the coach's games (final scores). |
losses | Int64 | Losses in the coach's games (final scores). |
win_pct | Float64 | Win fraction: wins divided by games, from the final scores. |
pts | Int64 | Points scored in the coach's games (final scores). |
opp_pts | Int64 | Points allowed in the coach's games (final scores). |
pbp_games | Int64 | The coach's games with published possessions; the ratings and four factors cover these. |
poss | Int64 | Offensive possessions in the coach's games. |
opp_poss | Int64 | Defensive possessions in the coach's games. |
poss_pts | Int64 | Points scored on those possessions (the off_rtg numerator; can differ from pts by a few points a game). |
opp_poss_pts | Int64 | Points allowed on those possessions (the def_rtg numerator). |
seconds | Float64 | Game clock, in seconds, that the coach's possessions used (the pace denominator). |
o_fga | Float64 | The team's field-goal attempts in the coach's games (a four-factor count; null when the source has none). |
d_fga | Float64 | Opponents' field-goal attempts in the coach's games (a four-factor count). |
o_fgm | Float64 | The team's field goals made in the coach's games (a four-factor count; null when the source has none). |
d_fgm | Float64 | Opponents' field goals made in the coach's games (a four-factor count). |
o_fg3m | Float64 | The team's three-pointers made in the coach's games (a four-factor count; null when the source has none). |
d_fg3m | Float64 | Opponents' three-pointers made in the coach's games (a four-factor count). |
o_fta | Float64 | The team's free-throw attempts in the coach's games (a four-factor count; null when the source has none). |
d_fta | Float64 | Opponents' free-throw attempts in the coach's games (a four-factor count). |
o_oreb | Float64 | The team's offensive rebounds in the coach's games (a four-factor count; null when the source has none). |
d_oreb | Float64 | Opponents' offensive rebounds in the coach's games (a four-factor count). |
o_dreb | Float64 | The team's defensive rebounds in the coach's games (a four-factor count; null when the source has none). |
d_dreb | Float64 | Opponents' defensive rebounds in the coach's games (a four-factor count). |
o_tov | Float64 | The team's turnovers in the coach's games (a four-factor count; null when the source has none). |
d_tov | Float64 | Opponents' turnovers in the coach's games (a four-factor count). |
o_ff_poss | Float64 | The 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_poss | Float64 | Opponents' possessions counted for the turnover rate (the box possessions in college) in the coach's games (a four-factor count). |
off_rtg | Float64 | Offensive rating: points scored per 100 offensive possessions, over the coach's games. |
def_rtg | Float64 | Defensive rating: points allowed per 100 defensive possessions, over the coach's games. |
net_rtg | Float64 | Net rating: off_rtg minus def_rtg. |
pace | Float64 | Pace: possessions per 40 minutes, the mean of poss and opp_poss over the game clock those possessions used. |
efg_pct | Float64 | Effective field-goal percentage, (FGM + 0.5 * 3PM) / FGA, as a fraction. |
tov_pct | Float64 | Turnovers per possession, as a fraction. |
orb_pct | Float64 | Offensive rebound rate: offensive rebounds over offensive-rebound chances (own OREB plus the defense's DREB), as a fraction. |
ft_rate | Float64 | Free-throw rate, FTA / FGA. |
opp_efg_pct | Float64 | Opponents' effective field-goal percentage, as a fraction. |
opp_tov_pct | Float64 | Opponents' turnovers per possession (turnovers forced), as a fraction. |
opp_orb_pct | Float64 | Opponents' offensive rebound rate, as a fraction. |
opp_ft_rate | Float64 | Opponents' free-throw rate, FTA / FGA. |
win_pct_rank | Float64 | Rank of win_pct among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
off_rtg_rank | Float64 | Rank of off_rtg among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
def_rtg_rank | Float64 | Rank of def_rtg among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the lowest value ranks 1; ties average). |
net_rtg_rank | Float64 | Rank of net_rtg among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
pace_rank | Float64 | Rank of pace among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
efg_pct_rank | Float64 | Rank of efg_pct among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
tov_pct_rank | Float64 | Rank of tov_pct among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the lowest value ranks 1; ties average). |
orb_pct_rank | Float64 | Rank of orb_pct among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
ft_rate_rank | Float64 | Rank of ft_rate among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
opp_efg_pct_rank | Float64 | Rank of opp_efg_pct among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the lowest value ranks 1; ties average). |
opp_tov_pct_rank | Float64 | Rank of opp_tov_pct among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the highest value ranks 1; ties average). |
opp_orb_pct_rank | Float64 | Rank of opp_orb_pct among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the lowest value ranks 1; ties average). |
opp_ft_rate_rank | Float64 | Rank of opp_ft_rate among coaches with at least one full season of games (the most games any team played in a season of the input; null under five) (the lowest value ranks 1; ties average). |
win_pct_pct | Float64 | Percentile of win_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
off_rtg_pct | Float64 | Percentile of off_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
def_rtg_pct | Float64 | Percentile of def_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
net_rtg_pct | Float64 | Percentile of net_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
pace_pct | Float64 | Percentile of pace among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
efg_pct_pct | Float64 | Percentile of efg_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
tov_pct_pct | Float64 | Percentile of tov_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
orb_pct_pct | Float64 | Percentile of orb_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
ft_rate_pct | Float64 | Percentile of ft_rate among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_efg_pct_pct | Float64 | Percentile of opp_efg_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_tov_pct_pct | Float64 | Percentile of opp_tov_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_orb_pct_pct | Float64 | Percentile of opp_orb_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_ft_rate_pct | Float64 | Percentile of opp_ft_rate among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
win_pct_n | Int64 | Sample size of win_pct: games. |
off_rtg_n | Int64 | Sample size of off_rtg: offensive possessions. |
def_rtg_n | Int64 | Sample size of def_rtg: defensive possessions. |
net_rtg_n | Int64 | Sample size of net_rtg: offensive plus defensive possessions. |
pace_n | Int64 | Sample size of pace: the games with possessions (pbp_games). |
efg_pct_n | Int64 | Sample size of efg_pct: field-goal attempts. |
tov_pct_n | Int64 | Sample size of tov_pct: turnover-rate possessions. |
orb_pct_n | Int64 | Sample size of orb_pct: offensive-rebound chances. |
ft_rate_n | Int64 | Sample size of ft_rate: field-goal attempts. |
opp_efg_pct_n | Int64 | Sample size of opp_efg_pct: opponents' field-goal attempts. |
opp_tov_pct_n | Int64 | Sample size of opp_tov_pct: opponents' turnover-rate possessions. |
opp_orb_pct_n | Int64 | Sample size of opp_orb_pct: opponents' offensive-rebound chances. |
opp_ft_rate_n | Int64 | Sample size of opp_ft_rate: opponents' field-goal attempts. |
wnba_coach_seasons
wnba_coach_seasons(seasons: 'int | list[int]', *, league_id: 'str' = '10', season_type: 'str' = 'regular-season', espn: 'bool' = True, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA head-coach seasons: W-L, ratings and four factors over each coach's games (league_id='10'). See sportsdataverse.nba.nba_coach_seasons.nba_coach_seasons.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
season_type | str | 'regular-season' | |
espn | bool | True | |
return_as_pandas | bool | False |
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_name | type | description |
|---|---|---|
season | Int64 | Season, named by the year it ends (2026 is 2025-26; the WNBA season is its calendar year). |
team_id | Int64 | stats.nba.com team id (the 10-digit franchise id). |
team | String | Team abbreviation (the stats schedule's). |
coach_id | Int64 | stats.nba.com coach id of the head coach (nba_stats_coaches / wnba_stats_coaches). |
coach | String | Head coach's name (stats.nba.com's staff list). |
role | String | HC: head coach (the only role the table carries). |
team_games | Int64 | The team's completed games in the season (and season type); games < team_games means the coach shared the season. |
first_game_date | Date | Date of the coach's first credited game that season. |
last_game_date | Date | Date of the coach's last credited game that season. |
games | Int64 | Games credited to the coach: each completed game goes to the coach of record for it. |
wins | Int64 | Wins in the coach's games (final scores). |
losses | Int64 | Losses in the coach's games (final scores). |
win_pct | Float64 | Win fraction: wins divided by games, from the final scores. |
pts | Int64 | Points scored in the coach's games (final scores). |
opp_pts | Int64 | Points allowed in the coach's games (final scores). |
pbp_games | Int64 | The coach's games with published possessions; the ratings and four factors cover these. |
poss | Int64 | Offensive possessions in the coach's games. |
opp_poss | Int64 | Defensive possessions in the coach's games. |
poss_pts | Int64 | Points scored on those possessions (the off_rtg numerator; can differ from pts by a few points a game). |
opp_poss_pts | Int64 | Points allowed on those possessions (the def_rtg numerator). |
seconds | Float64 | Game clock, in seconds, that the coach's possessions used (the pace denominator). |
o_fga | Float64 | The team's field-goal attempts in the coach's games (a four-factor count; null when the source has none). |
d_fga | Float64 | Opponents' field-goal attempts in the coach's games (a four-factor count). |
o_fgm | Float64 | The team's field goals made in the coach's games (a four-factor count; null when the source has none). |
d_fgm | Float64 | Opponents' field goals made in the coach's games (a four-factor count). |
o_fg3m | Float64 | The team's three-pointers made in the coach's games (a four-factor count; null when the source has none). |
d_fg3m | Float64 | Opponents' three-pointers made in the coach's games (a four-factor count). |
o_fta | Float64 | The team's free-throw attempts in the coach's games (a four-factor count; null when the source has none). |
d_fta | Float64 | Opponents' free-throw attempts in the coach's games (a four-factor count). |
o_oreb | Float64 | The team's offensive rebounds in the coach's games (a four-factor count; null when the source has none). |
d_oreb | Float64 | Opponents' offensive rebounds in the coach's games (a four-factor count). |
o_dreb | Float64 | The team's defensive rebounds in the coach's games (a four-factor count; null when the source has none). |
d_dreb | Float64 | Opponents' defensive rebounds in the coach's games (a four-factor count). |
o_tov | Float64 | The team's turnovers in the coach's games (a four-factor count; null when the source has none). |
d_tov | Float64 | Opponents' turnovers in the coach's games (a four-factor count). |
o_ff_poss | Float64 | The 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_poss | Float64 | Opponents' possessions counted for the turnover rate (the box possessions in college) in the coach's games (a four-factor count). |
off_rtg | Float64 | Offensive rating: points scored per 100 offensive possessions, over the coach's games. |
def_rtg | Float64 | Defensive rating: points allowed per 100 defensive possessions, over the coach's games. |
net_rtg | Float64 | Net rating: off_rtg minus def_rtg. |
pace | Float64 | Pace: possessions per 40 minutes, the mean of poss and opp_poss over the game clock those possessions used. |
efg_pct | Float64 | Effective field-goal percentage, (FGM + 0.5 * 3PM) / FGA, as a fraction. |
tov_pct | Float64 | Turnovers per possession, as a fraction. |
orb_pct | Float64 | Offensive rebound rate: offensive rebounds over offensive-rebound chances (own OREB plus the defense's DREB), as a fraction. |
ft_rate | Float64 | Free-throw rate, FTA / FGA. |
opp_efg_pct | Float64 | Opponents' effective field-goal percentage, as a fraction. |
opp_tov_pct | Float64 | Opponents' turnovers per possession (turnovers forced), as a fraction. |
opp_orb_pct | Float64 | Opponents' offensive rebound rate, as a fraction. |
opp_ft_rate | Float64 | Opponents' free-throw rate, FTA / FGA. |
win_pct_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_rank | Float64 | Rank 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_pct | Float64 | Percentile of win_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
off_rtg_pct | Float64 | Percentile of off_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
def_rtg_pct | Float64 | Percentile of def_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
net_rtg_pct | Float64 | Percentile of net_rtg among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
pace_pct | Float64 | Percentile of pace among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
efg_pct_pct | Float64 | Percentile of efg_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
tov_pct_pct | Float64 | Percentile of tov_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
orb_pct_pct | Float64 | Percentile of orb_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
ft_rate_pct | Float64 | Percentile of ft_rate among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_efg_pct_pct | Float64 | Percentile of opp_efg_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_tov_pct_pct | Float64 | Percentile of opp_tov_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_orb_pct_pct | Float64 | Percentile of opp_orb_pct among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
opp_ft_rate_pct | Float64 | Percentile of opp_ft_rate among the same qualified coaches: 100 * (n + 1 - rank) / (n + 1), n the qualifiers with a value. |
win_pct_n | Int64 | Sample size of win_pct: games. |
off_rtg_n | Int64 | Sample size of off_rtg: offensive possessions. |
def_rtg_n | Int64 | Sample size of def_rtg: defensive possessions. |
net_rtg_n | Int64 | Sample size of net_rtg: offensive plus defensive possessions. |
pace_n | Int64 | Sample size of pace: the games with possessions (pbp_games). |
efg_pct_n | Int64 | Sample size of efg_pct: field-goal attempts. |
tov_pct_n | Int64 | Sample size of tov_pct: turnover-rate possessions. |
orb_pct_n | Int64 | Sample size of orb_pct: offensive-rebound chances. |
ft_rate_n | Int64 | Sample size of ft_rate: field-goal attempts. |
opp_efg_pct_n | Int64 | Sample size of opp_efg_pct: opponents' field-goal attempts. |
opp_tov_pct_n | Int64 | Sample size of opp_tov_pct: opponents' turnover-rate possessions. |
opp_orb_pct_n | Int64 | Sample size of opp_orb_pct: opponents' offensive-rebound chances. |
opp_ft_rate_n | Int64 | Sample size of opp_ft_rate: opponents' field-goal attempts. |
wnba_draft_lottery_odds
wnba_draft_lottery_odds(*, league_id: 'str' = '10', chances: 'Sequence[float] | None' = None, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA draft-lottery odds by slot, two picks drawn (league_id='10'). See sportsdataverse.nba.nba_season_rules.nba_draft_lottery_odds.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
league_id | str | '10' | |
chances | Sequence[float] | None | None | |
return_as_pandas | bool | False |
Returns
One row per (lottery_slot, pick): lottery_slot (1 = the worst record), chances (the slot's chances), pick and probability.
| col_name | type | description |
|---|---|---|
lottery_slot | Int64 | Pre-lottery slot, 1 = the worst record. |
chances | Float64 | The slot's chances in 1,000 (NBA 2019 table; WNBA published table or the caller's). |
pick | Int64 | Draft pick number. |
probability | Float64 | Exact probability that the slot gets the pick, from enumerating every ordered draw. |
wnba_epv_lineup_games
wnba_epv_lineup_games(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
Per WNBA five-woman unit and game: the EPV added with the unit on the floor.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | A season or list of seasons (the WNBA season is its year), from the booster's first training season (2022) on. | |
return_as_pandas | bool | False | Return a pandas frame instead of polars. |
Returns
sportsdataverse.nba.nba_epv.epv_lineup_games of the seasons' plays: one row per (season, game_id, team_id, lineup_id) with off_epv, def_epv, net_epv and plays.
| col_name | type | description |
|---|---|---|
season | Int64 | Season: the WNBA season is its calendar year. |
game_id | String | stats.wnba.com game id (e.g. 1022600001). |
team_id | Int64 | stats.wnba.com team id. |
lineup_id | String | The five player ids, sorted and joined with '-'. |
off_epv | Float64 | EPV added by the unit's team with the ball while the unit was on. An ordinary free throw counts for the lineup on the floor at its foul, not the one after a substitution. |
def_epv | Float64 | EPV added by the opponent with the ball while the unit was on. An ordinary free throw counts for the lineup on the floor at its foul, not the one after a substitution. |
net_epv | Float64 | off_epv - def_epv. |
plays | Int64 | Play-by-play events with the unit on the floor. |
Raises
| Exception | Description |
|---|---|
ValueError | If a season is before the first one served, or a game has no date in the schedule release (a schedule that lags the play-by-play fails the season loudly). |
Example
from sportsdataverse.wnba.wnba_epv import wnba_epv_lineup_games
wnba_epv_lineup_games(2026).sort("net_epv", descending=True).head()
wnba_epv_player_games
wnba_epv_player_games(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
Per WNBA player and game: EPV added on her own actions and on-court EPV +/-.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | A season or list of seasons (the WNBA season is its year), from the booster's first training season (2022) on. | |
return_as_pandas | bool | False | Return a pandas frame instead of polars. |
Returns
sportsdataverse.nba.nba_epv.epv_player_games of the seasons' plays, on-court from the wnba_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.
| col_name | type | description |
|---|---|---|
season | Int64 | Season: the WNBA season is its calendar year. |
game_id | String | stats.wnba.com game id (e.g. 1022600001). |
team_id | Int64 | stats.wnba.com team id. |
player_id | Int64 | stats.wnba.com player (person) id. |
epv_own | Float64 | EPV 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_actions | Int64 | How many of the player's own events were credited. |
off_epv_on | Float64 | EPV added by the player's team with the ball while the player was on the floor. An ordinary free throw counts for the lineup on the floor at its foul, not the one after a substitution. |
def_epv_on | Float64 | EPV added by the opponent with the ball while the player was on the floor. An ordinary free throw counts for the lineup on the floor at its foul, not the one after a substitution. |
epv_on | Float64 | On-court EPV +/-: off_epv_on - def_epv_on. |
Raises
| Exception | Description |
|---|---|
ValueError | If a season is before the first one served, or a game has no date in the schedule release (a schedule that lags the play-by-play fails the season loudly). |
Example
from sportsdataverse.wnba.wnba_epv import wnba_epv_player_games
wnba_epv_player_games(2026).sort("epv_on", descending=True).head()
wnba_epv_plays
wnba_epv_plays(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
EPV and EPV added on every WNBA play-by-play event inside a possession.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | A season or list of seasons (the WNBA season is its year), from the booster's first training season (2022) on. | |
return_as_pandas | bool | False | Return a pandas frame instead of polars. |
Returns
The columns of sportsdataverse.nba.nba_epv.nba_epv_plays, one row per event in game order, with stats.wnba.com ids. Every game of every season type is scored.
| col_name | type | description |
|---|---|---|
season | Int64 | Season: the WNBA season is its calendar year. |
game_id | String | stats.wnba.com game id (e.g. 1022600001). |
possession_number | Int64 | The possession's number in the game (the possessions release's). |
step | Int64 | The event's place in its possession, from 1. |
order_index | Int64 | The event's order in the game's play-by-play. |
action_number | Int64 | stats.wnba.com action number of the event (the game lineups release's key). |
offense_team_id | Int64 | Team id of the offense (the team with the ball). |
defense_team_id | Int64 | Team id of the defense. |
home_team_id | Int64 | Team id of the home team. |
team_id | Int64 | Team 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_id | Int64 | Player id on the event; the team id, or 0, on team events. |
event_type | String | The release's event type (made_shot, missed_shot, rebound, foul, free_throw, turnover, ...). |
sub_type | String | The release's event sub type (the foul or free-throw kind, the shot type, ...). |
description | String | The play-by-play text of the event. |
off_player_1 | Int64 | stats.wnba.com player id of offensive player 1 of 5 when the possession started. |
off_player_2 | Int64 | stats.wnba.com player id of offensive player 2 of 5 when the possession started. |
off_player_3 | Int64 | stats.wnba.com player id of offensive player 3 of 5 when the possession started. |
off_player_4 | Int64 | stats.wnba.com player id of offensive player 4 of 5 when the possession started. |
off_player_5 | Int64 | stats.wnba.com player id of offensive player 5 of 5 when the possession started. |
def_player_1 | Int64 | stats.wnba.com player id of defensive player 1 of 5 when the possession started. |
def_player_2 | Int64 | stats.wnba.com player id of defensive player 2 of 5 when the possession started. |
def_player_3 | Int64 | stats.wnba.com player id of defensive player 3 of 5 when the possession started. |
def_player_4 | Int64 | stats.wnba.com player id of defensive player 4 of 5 when the possession started. |
def_player_5 | Int64 | stats.wnba.com player id of defensive player 5 of 5 when the possession started. |
start_type | Int64 | State: how the possession started, 0 dead ball, 1 timeout, 2 made shot, 3 missed shot, 4 live-ball turnover. |
period | Int64 | State: the period, overtimes folded to 5. |
seconds_remaining | Float64 | State: seconds left in the period after the event. |
start_margin | Float64 | State: the offense's lead when the possession started (before its first event). |
transition | Int64 | State: 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_event | Int64 | State: the event just processed, coded by its index in nba_epv.LAST_EVENTS (11 the start). |
ft_pending | Int64 | State: free throws still to come in the trip. |
shot_zone | Int64 | State: zone of the possession's latest shot, 0 none, 1 rim, 2 short, 3 mid two, 4 three. |
points | Int64 | The offense's points on the event. |
remaining_points | Int64 | The offense's points after the event to the end of the possession (the model's label). |
is_last | Boolean | Whether the event is its possession's last. |
next_in_period | Boolean | Whether another possession follows in the same period. |
epv | Float64 | Expected points for the offense to the end of the possession, after the event. Scaled by the game's as-of scoring level (the season's points per possession on earlier dates). |
epv_start | Float64 | EPV at the possession's start. |
epv_before | Float64 | EPV before the event (the previous event's, or the start's). |
epv_after | Float64 | EPV 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_added | Float64 | EPV added: points + epv_after - epv_before, the offense's (the defense's is its negative). |
Raises
| Exception | Description |
|---|---|
ValueError | If a season is before the first one served, or a game has no date in the schedule release (a schedule that lags the play-by-play fails the season loudly). |
Example
from sportsdataverse.wnba.wnba_epv import wnba_epv_plays
plays = wnba_epv_plays(2026)
plays.sort("epv_added", descending=True).head(5)
wnba_epv_team_games
wnba_epv_team_games(seasons: 'int | list[int]', *, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
Per WNBA team and game: EPV added on offense and allowed on defense.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | A season or list of seasons (the WNBA season is its year), from the booster's first training season (2022) on. | |
return_as_pandas | bool | False | Return a pandas frame instead of polars. |
Returns
sportsdataverse.nba.nba_epv.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_name | type | description |
|---|---|---|
season | Int64 | Season: the WNBA season is its calendar year. |
game_id | String | stats.wnba.com game id (e.g. 1022600001). |
team_id | Int64 | stats.wnba.com team id. |
opp_team_id | Int64 | The opponent's team id. |
off_epv | Float64 | The team's EPV added with the ball over the game. |
poss | Int64 | The team's possessions with at least one event. |
def_epv | Float64 | The opponent's EPV added with the ball over the game. |
opp_poss | Int64 | The opponent's possessions with at least one event. |
net_epv | Float64 | off_epv - def_epv. |
off_epv_per_poss | Float64 | off_epv per possession. |
def_epv_per_poss | Float64 | def_epv per possession. |
Raises
| Exception | Description |
|---|---|
ValueError | If a season is before the first one served, or a game has no date in the schedule release (a schedule that lags the play-by-play fails the season loudly). |
Example
import polars as pl
from sportsdataverse.wnba.wnba_epv import wnba_epv_team_games
teams = wnba_epv_team_games(2026)
teams.group_by("team_id").agg(pl.col("off_epv_per_poss").mean()).sort("off_epv_per_poss")
wnba_expected_turnovers
wnba_expected_turnovers(season: 'str', *, base: "'Optional[pl.DataFrame]'" = None, player_mix: "'Optional[pl.DataFrame]'" = None, return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"
WNBA expected turnovers / ball-security skill (league_id="10").
Thin wrapper binding
sportsdataverse.nba.nba_expected_turnovers.nba_expected_turnovers
to the women's league.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
season | str | Season string, e.g. "2024". | |
base | Optional[DataFrame] | None | Injected nba_stats_leaguedashplayerstats (Base) frame. |
player_mix | Optional[DataFrame] | None | Injected Synergy player-level offensive mix. |
return_as_pandas | bool | False | Return a pandas DataFrame instead of polars. |
Returns
Same schema as sportsdataverse.nba.nba_expected_turnovers.nba_expected_turnovers.
No returns table is published for this function: no capture: it reads stats.nba.com (WNBA league id 10), which answers HTTP 403 to the datacenter IP the docs are built on; the function works from a residential IP.
Example
from sportsdataverse.wnba import wnba_expected_turnovers
t = wnba_expected_turnovers("2024")
print(t.sort("ball_security_skill", descending=True).head())
wnba_foul_drawing
wnba_foul_drawing(season: 'str', *, 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]'"
WNBA foul-drawing / FT-generation (league_id="10").
Thin wrapper binding
sportsdataverse.nba.nba_foul_drawing.nba_foul_drawing to the
women's league.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
season | str | Season string, e.g. "2024". | |
base | Optional[DataFrame] | None | Injected nba_stats_leaguedashplayerstats (Base) frame. |
advanced | Optional[DataFrame] | None | Injected Advanced-measure frame. |
player_mix | Optional[DataFrame] | None | Injected Synergy player-level offensive mix. |
return_as_pandas | bool | False | Return a pandas DataFrame instead of polars. |
Returns
Same schema as sportsdataverse.nba.nba_foul_drawing.nba_foul_drawing.
No returns table is published for this function: no capture: it reads stats.nba.com (WNBA league id 10), which answers HTTP 403 to the datacenter IP the docs are built on; the function works from a residential IP.
Example
from sportsdataverse.wnba import wnba_foul_drawing
f = wnba_foul_drawing("2024")
print(f.sort("foul_draw_skill", descending=True).head())
wnba_game_flow
wnba_game_flow(seasons: 'int | list[int]', *, league_id: 'str' = '10', season_type: 'str' = 'regular-season', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA game flow per team and game: runs, droughts, kills, lead changes, time leading, game control (league_id='10'). See sportsdataverse.nba.nba_game_flow.nba_game_flow.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
season_type | str | 'regular-season' | |
return_as_pandas | bool | False |
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_name | type | description |
|---|---|---|
season | Int64 | Season, named by the year it ends (the WNBA season is its calendar year). |
game_id | String | stats.wnba.com game id (e.g. 1022500001). |
team_id | Int64 | stats.wnba.com team id. |
opp_team_id | Int64 | The opponent's team id. |
is_home | Boolean | True for the home side. |
pts | Int64 | The team's final points: its running score after the last play. |
opp_pts | Int64 | The opponent's final points. |
won | Boolean | True when pts > opp_pts. |
game_seconds | Float64 | Game length in seconds: regulation plus the overtimes played. |
lead_sec | Float64 | Game-clock seconds with the team ahead; the score after a play holds until the next play. |
trail_sec | Float64 | Game-clock seconds with the team behind. |
tied_sec | Float64 | Game-clock seconds with the score level, the clock before the first play included. |
lead_pct | Float64 | lead_sec / game_seconds. |
lead_changes | Int64 | How 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_tied | Int64 | How often the score became level, the 0-0 start not counted; the same on both rows of a game. |
largest_lead | Int64 | The team's biggest lead in points (0 if never ahead). |
largest_deficit | Int64 | The team's biggest deficit in points (0 if never behind). |
comeback | Int64 | largest_deficit for a game the team won, else 0. |
max_run | Int64 | The 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_10 | Int64 | The team's runs of 10 or more unanswered points. |
opp_runs_10 | Int64 | The opponent's runs of 10 or more unanswered points (a non-D1 opponent's included). |
longest_drought_sec | Float64 | The 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_margin | Float64 | Game control: the team's score margin averaged over the game clock. |
avg_wp | Float64 | Game 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_poss | Int64 | The team's defensive possessions (every row of the possessions release); null for a game with no published possessions. |
stops | Int64 | Defensive possessions on which the opponent scored no points. |
kills | Int64 | Kills: 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_kills | Int64 | Double kills: each run of n straight stops adds n // 6 (six straight stops are two kills and one double kill). |
wnba_game_lineups_used
wnba_game_lineups_used(seasons: 'int | list[int]', *, league_id: 'str' = '10', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA lineups used per game (league_id='10'). See sportsdataverse.nba.nba_game_impact.nba_game_lineups_used.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
return_as_pandas | bool | False |
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_name | type | description |
|---|---|---|
season | Int64 | Season, named by the year it ends (the WNBA season is its calendar year). |
game_id | String | stats.nba.com game id (e.g. 0022500101). |
team_id | Int64 | stats.nba.com team id. |
opp_team_id | Int64 | The opponent's team id. |
lineup_id | String | The five player ids of the unit, sorted and joined with '-'. |
player_1 | Int64 | Player 1 of the unit, in lineup_id order. |
player_2 | Int64 | Player 2 of the unit, in lineup_id order. |
player_3 | Int64 | Player 3 of the unit, in lineup_id order. |
player_4 | Int64 | Player 4 of the unit, in lineup_id order. |
player_5 | Int64 | Player 5 of the unit, in lineup_id order. |
minutes | Float64 | Game-clock minutes on the floor (seconds / 60). |
seconds | Float64 | Game-clock seconds on the floor: the clock that ran into each action, credited to the lineup at that action. |
poss | Int64 | Offensive possessions on the floor (a possession counts for the five on the floor when it starts). |
opp_poss | Int64 | Defensive possessions on the floor. |
pts | Int64 | The 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_pts | Int64 | The opponent's points while on the floor, credited as pts is. |
plus_minus | Int64 | On-court +/-: pts - opp_pts. |
off_rtg | Float64 | On-court offensive rating: pts per 100 poss; null with no offensive possessions. |
def_rtg | Float64 | On-court defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions. |
net_rtg | Float64 | On-court net rating: off_rtg - def_rtg; null when either is null. |
off_rtg_n | Int64 | Sample size of off_rtg: poss. |
def_rtg_n | Int64 | Sample size of def_rtg: opp_poss. |
net_rtg_n | Int64 | Sample size of net_rtg: poss + opp_poss. |
wnba_game_on_off
wnba_game_on_off(seasons: 'int | list[int]', *, league_id: 'str' = '10', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA in-game on/off (league_id='10'). See sportsdataverse.nba.nba_game_stints.nba_game_on_off.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
return_as_pandas | bool | False |
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_name | type | description |
|---|---|---|
season | Int64 | Season, named by the year it ends (the WNBA season is its calendar year). |
game_id | String | stats.nba.com game id (e.g. 0022500101). |
team_id | Int64 | stats.nba.com team id. |
opp_team_id | Int64 | The opponent's team id. |
player_id | Int64 | stats.nba.com player (person) id. |
minutes_on | Float64 | Game-clock minutes of the team's game with the player on the floor. |
poss_on | Int64 | The team's offensive possessions with the player on the floor (a possession belongs to the five on the floor when it starts). |
opp_poss_on | Int64 | The team's defensive possessions with the player on the floor. |
pts_on | Int64 | The 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_on | Int64 | The opponent's points with the player on the floor, credited as pts_on is. |
plus_minus_on | Int64 | pts_on - opp_pts_on. |
off_rtg_on | Float64 | Offensive rating with the player on the floor: pts_on per 100 poss_on; null with no possessions. |
def_rtg_on | Float64 | Defensive rating with the player on the floor: opp_pts_on per 100 opp_poss_on; null with no possessions. |
net_rtg_on | Float64 | Net rating with the player on the floor: off_rtg_on - def_rtg_on; null when either is null. |
minutes_off | Float64 | Game-clock minutes of the team's game with the player off the floor (the rest of the team's game). |
poss_off | Int64 | The 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_off | Int64 | The team's defensive possessions with the player off the floor (the rest of the team's game). |
pts_off | Int64 | The 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_off | Int64 | The opponent's points with the player off the floor (the rest of the team's game), credited as pts_off is. |
plus_minus_off | Int64 | pts_off - opp_pts_off. |
off_rtg_off | Float64 | Offensive 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_off | Float64 | Defensive 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_off | Float64 | Net 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_diff | Float64 | On-off offensive rating: off_rtg_on - off_rtg_off; null when either is null. |
def_rtg_diff | Float64 | On-off defensive rating: def_rtg_on - def_rtg_off; null when either is null. |
net_rtg_diff | Float64 | On-off net rating: net_rtg_on - net_rtg_off; null when either is null. |
off_rtg_on_n | Int64 | Sample size of off_rtg_on: poss_on. |
def_rtg_on_n | Int64 | Sample size of def_rtg_on: opp_poss_on. |
net_rtg_on_n | Int64 | Sample size of net_rtg_on: poss_on + opp_poss_on. |
off_rtg_off_n | Int64 | Sample size of off_rtg_off: poss_off. |
def_rtg_off_n | Int64 | Sample size of def_rtg_off: opp_poss_off. |
net_rtg_off_n | Int64 | Sample size of net_rtg_off: poss_off + opp_poss_off. |
off_rtg_diff_n | Int64 | Sample size of off_rtg_diff: the smaller of off_rtg_on_n and off_rtg_off_n. |
def_rtg_diff_n | Int64 | Sample size of def_rtg_diff: the smaller of def_rtg_on_n and def_rtg_off_n. |
net_rtg_diff_n | Int64 | Sample size of net_rtg_diff: the smaller of net_rtg_on_n and net_rtg_off_n. |
wnba_game_player_box_splits
wnba_game_player_box_splits(seasons: 'int | list[int]', *, league_id: 'str' = '10', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA player box by game, period and garbage time (league_id='10'). See sportsdataverse.nba.nba_game_stints.nba_game_player_box_splits.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
return_as_pandas | bool | False |
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_name | type | description |
|---|---|---|
season | Int64 | Season, named by the year it ends (the WNBA season is its calendar year). |
game_id | String | stats.nba.com game id (e.g. 0022500101). |
team_id | Int64 | stats.nba.com team id. |
player_id | Int64 | stats.nba.com player (person) id. |
family | String | Split family: all (the game), period (one row per period he played) or garbage (garbage time in and out). |
split | String | The 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). |
period | Int64 | The period of a period row; null on the other families. |
seconds | Float64 | Game-clock seconds he was on the floor in the split (an action's clock goes to the lineup at it). |
minutes | Float64 | Game-clock minutes on the floor in the split (seconds / 60). |
points | Int64 | Points the player scored: 2 or 3 per made field goal and 1 per made free throw. |
fgm | Int64 | Field goals made. |
fga | Int64 | Field goals attempted. |
fg3m | Int64 | Three-pointers made. |
fg3a | Int64 | Three-pointers attempted. |
ftm | Int64 | Free throws made. |
fta | Int64 | Free throws attempted. |
oreb | Int64 | Offensive rebounds (a team rebound is no player's). |
dreb | Int64 | Defensive rebounds (a team rebound is no player's). |
reb | Int64 | Total rebounds: oreb + dreb. |
ast | Int64 | Assists: made field goals the play-by-play credits him as the passer on. |
stl | Int64 | Steals he is credited with. |
blk | Int64 | Shots he blocked. |
tov | Int64 | Turnovers (a team turnover is no player's). |
pf | Int64 | Personal fouls (technicals are not counted). |
on_floor_at_end | Boolean | On a period row, whether he was in his side's lineup at the period's last action; null on the other families. |
wnba_game_player_impact
wnba_game_player_impact(seasons: 'int | list[int]', *, league_id: 'str' = '10', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA game impact box (league_id='10'). See sportsdataverse.nba.nba_game_impact.nba_game_player_impact.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
return_as_pandas | bool | False |
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_name | type | description |
|---|---|---|
season | Int64 | Season, named by the year it ends (the WNBA season is its calendar year). |
game_id | String | stats.nba.com game id (e.g. 0022500101). |
team_id | Int64 | stats.nba.com team id. |
opp_team_id | Int64 | The opponent's team id. |
player_id | Int64 | stats.nba.com player (person) id. |
minutes | Float64 | Game-clock minutes on the floor (seconds / 60). |
seconds | Float64 | Game-clock seconds on the floor: the clock that ran into each action, credited to the lineup at that action. |
poss | Int64 | Offensive possessions on the floor (a possession counts for the five on the floor when it starts). |
opp_poss | Int64 | Defensive possessions on the floor. |
pts | Int64 | The 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_pts | Int64 | The opponent's points while on the floor, credited as pts is. |
plus_minus | Int64 | On-court +/-: pts - opp_pts. |
off_rtg | Float64 | On-court offensive rating: pts per 100 poss; null with no offensive possessions. |
def_rtg | Float64 | On-court defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions. |
net_rtg | Float64 | On-court net rating: off_rtg - def_rtg; null when either is null. |
off_rtg_n | Int64 | Sample size of off_rtg: poss. |
def_rtg_n | Int64 | Sample size of def_rtg: opp_poss. |
net_rtg_n | Int64 | Sample size of net_rtg: poss + opp_poss. |
wnba_game_stints
wnba_game_stints(seasons: 'int | list[int]', *, league_id: 'str' = '10', return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'
WNBA game stints (league_id='10'). See sportsdataverse.nba.nba_game_stints.nba_game_stints.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
seasons | int | list[int] | ||
league_id | str | '10' | |
return_as_pandas | bool | False |
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_name | type | description |
|---|---|---|
season | Int64 | Season, named by the year it ends (the WNBA season is its calendar year). |
game_id | String | stats.nba.com game id (e.g. 0022500101). |
team_id | Int64 | stats.nba.com team id. |
opp_team_id | Int64 | The opponent's team id. |
player_id | Int64 | stats.nba.com player (person) id. |
stint_number | Int64 | The 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. |
period | Int64 | Period of the stint (a stint never spans a period end). |
clock_in | Float64 | Period clock (seconds left) when the stint began: the clock at the action before his first. |
clock_out | Float64 | Period clock (seconds left) when the stint ended: the clock at his last action. |
seconds | Float64 | Game-clock seconds of the stint: the clock that ran into each of its actions. |
minutes | Float64 | Game-clock minutes of the stint (seconds / 60). |
poss | Int64 | Offensive possessions that started during the stint (each counted on the lineup at the action that starts it). |
opp_poss | Int64 | Defensive possessions that started during the stint, counted as poss is. |
pts | Int64 | The 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_pts | Int64 | The opponent's points during the stint, credited as pts is. |
plus_minus | Int64 | The stint's +/-: pts - opp_pts. |
points | Int64 | Points the player scored: 2 or 3 per made field goal and 1 per made free throw, his own, on the stint's actions. |
fgm | Int64 | Field goals made, his own, on the stint's actions. |
fga | Int64 | Field goals attempted, his own, on the stint's actions. |
fg3m | Int64 | Three-pointers made, his own, on the stint's actions. |
fg3a | Int64 | Three-pointers attempted, his own, on the stint's actions. |
ftm | Int64 | Free throws made, his own, on the stint's actions. |
fta | Int64 | Free throws attempted, his own, on the stint's actions. |
oreb | Int64 | Offensive rebounds (a team rebound is no player's), his own, on the stint's actions. |
dreb | Int64 | Defensive rebounds (a team rebound is no player's), his own, on the stint's actions. |
reb | Int64 | Total rebounds in the stint: oreb + dreb. |
ast | Int64 | Assists: made field goals the play-by-play credits him as the passer on, his own, on the stint's actions. |
stl | Int64 | Steals, his own, on the stint's actions. |
blk | Int64 | Blocked shots, his own, on the stint's actions. |
tov | Int64 | Turnovers (a team turnover is no player's), his own, on the stint's actions. |
pf | Int64 | Personal fouls (technicals are not counted), his own, on the stint's actions. |