Skip to main content

Men's college basketball — additional Python functions — Analytics: mbb_player–mbb_team

mbb_player_wowy​

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

College 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 (2025 is 2024-25).
leaguestr'mens'"mens" or "womens" (sportsdataverse.wbb.wbb_player_on_off.wbb_player_wowy).
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 sorting first as a string) 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 (2025 is 2024-25).
team_idInt64ESPN team id; a non-D1 team has none and gets no rows.
player_id_aStringThe first player of the pair, the smaller id as a string.
player_id_bStringThe second player of the pair, the larger id as a string.
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 is not "mens" or "womens".

Example

from sportsdataverse.mbb.mbb_player_on_off import mbb_player_wowy
pairs = mbb_player_wowy(2025)
pairs.sort("minutes_both", descending=True).head()

mbb_shot_selection​

mbb_shot_selection(scored: 'pl.DataFrame', *, group: 'str' = 'shooter_id', league: 'str' = 'mens', return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"

Per shooter/team expected points per attempt vs the league-average mix.

Parameters

ParameterTypeDefaultDescription
scoredDataFramembb_shot_quality output (needs xpoints, point_value, made + the group column).
groupstr'shooter_id'"shooter_id" or "team_id".
leaguestr'mens'"mens" or "womens" (interface parity; the math is league-free).
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per group: {group}:Utf8, n_shots:Int64, xppp, actual_ppp, selection_value, selection_value_total (all value columns Float64). The attempt-weighted selection_value sums to zero across the league. Empty input returns the zero-row schema.

col_nametypedescription
shooter_idStringUnique identifier for shooter.
n_shotsInt64
xpppFloat64
actual_pppFloat64
selection_valueFloat64
selection_value_totalFloat64

Raises

ExceptionDescription
ValueErrorUnknown group.

Example

from sportsdataverse.mbb import mbb_shot_data, mbb_shot_quality, mbb_shot_selection
sel = mbb_shot_selection(mbb_shot_quality(mbb_shot_data(2025)), group="team_id")

# Pipeline next step (one line)

sel.sort("selection_value", descending=True).head(10)

mbb_situational_lineup​

mbb_situational_lineup(seasons: 'int | list[int]', *, league: 'str' = 'mens', top_n: 'int' = 25, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

College five-man unit splits by situation: the team splits over the possessions each unit started.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26).
leaguestr'mens'"mens" or "womens".
top_nint25As mbb_situational_team.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id, lineup_id, family, split) with the columns of sportsdataverse.nba.nba_situational.nba_situational_lineup (String player ids). 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_idInt64ESPN team id of the team (Int64).
lineup_idStringThe five player ids of the unit on the floor as the possession starts, sorted and joined with '-' (BB-D4's id).
player_1StringPlayer 1 of the unit, in lineup_id order.
player_2StringPlayer 2 of the unit, in lineup_id order.
player_3StringPlayer 3 of the unit, in lineup_id order.
player_4StringPlayer 4 of the unit, in lineup_id order.
player_5StringPlayer 5 of the unit, in lineup_id order.
familyStringThe split family: all, clutch, period, half, garbage, score, venue, opponent or play_type (college has no second-chance flag, so no chance family); within a family the splits add up to the all row.
splitStringThe split: all; clutch / not_clutch; p1..p4 / ot (p1, p2 for halves); h1 / h2 / ot; garbage_time / not_garbage_time; leading / tied / trailing; home / away / neutral; vs_top / vs_rest; transition / half_court.
gamesInt64Games with at least one possession in the split (does not add up across a family).
minutesFloat64Game-clock minutes of the split's possessions (seconds / 60).
secondsFloat64Game-clock seconds of the split's possessions: each possession's start clock minus its end clock.
possInt64Offensive possessions in the split.
opp_possInt64Defensive possessions in the split.
ptsInt64Points scored on the offensive possessions.
opp_ptsInt64Points allowed on the defensive possessions.
plus_minusInt64Plus-minus over the split: pts - opp_pts.
off_rtgFloat64Offensive rating: pts per 100 poss; null with no offensive possessions.
def_rtgFloat64Defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions.
net_rtgFloat64Net rating: off_rtg - def_rtg; null when either is null.
off_rtg_nInt64Sample size of off_rtg: poss.
def_rtg_nInt64Sample size of def_rtg: opp_poss.
net_rtg_nInt64Sample size of net_rtg: poss + opp_poss.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens", or top_n is below 1.

Example

from sportsdataverse.mbb.mbb_situational import mbb_situational_lineup
mbb_situational_lineup(2026).filter(split="not_garbage_time").sort("poss", descending=True).head()

mbb_situational_player​

mbb_situational_player(seasons: 'int | list[int]', *, league: 'str' = 'mens', top_n: 'int' = 25, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

College player on-floor splits by situation: the team splits over the possessions each player started.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26).
leaguestr'mens'"mens" or "womens".
top_nint25As mbb_situational_team.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id, player_id, family, split) with the columns of sportsdataverse.nba.nba_situational.nba_situational_player; player_id is the stats.ncaa.org player id (String). Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (the WNBA season is its calendar year).
team_idInt64ESPN team id of the team (Int64).
player_idStringstats.ncaa.org player id (no NCAA-to-ESPN player crosswalk yet). A possession counts for the five on the floor as it starts, with all its points.
familyStringThe split family: all, clutch, period, half, garbage, score, venue, opponent or play_type (college has no second-chance flag, so no chance family); within a family the splits add up to the all row.
splitStringThe split: all; clutch / not_clutch; p1..p4 / ot (p1, p2 for halves); h1 / h2 / ot; garbage_time / not_garbage_time; leading / tied / trailing; home / away / neutral; vs_top / vs_rest; transition / half_court.
gamesInt64Games with at least one possession in the split (does not add up across a family).
minutesFloat64Game-clock minutes of the split's possessions (seconds / 60).
secondsFloat64Game-clock seconds of the split's possessions: each possession's start clock minus its end clock.
possInt64Offensive possessions in the split.
opp_possInt64Defensive possessions in the split.
ptsInt64Points scored on the offensive possessions.
opp_ptsInt64Points allowed on the defensive possessions.
plus_minusInt64Plus-minus over the split: pts - opp_pts.
off_rtgFloat64Offensive rating: pts per 100 poss; null with no offensive possessions.
def_rtgFloat64Defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions.
net_rtgFloat64Net rating: off_rtg - def_rtg; null when either is null.
off_rtg_nInt64Sample size of off_rtg: poss.
def_rtg_nInt64Sample size of def_rtg: opp_poss.
net_rtg_nInt64Sample size of net_rtg: poss + opp_poss.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens", or top_n is below 1.

Example

from sportsdataverse.mbb.mbb_situational import mbb_situational_player
mbb_situational_player(2026).filter(split="clutch").sort("net_rtg_n", descending=True).head()

mbb_situational_team​

mbb_situational_team(seasons: 'int | list[int]', *, league: 'str' = 'mens', top_n: 'int' = 25, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

College team splits by situation: clutch, period, half, garbage time, score, venue, opponent, play type.

The families and their splits are in sportsdataverse._common.situational_splits; within a family the splits add up to the all row.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26).
leaguestr'mens'"mens" or "womens" (sportsdataverse.wbb.wbb_situational.wbb_situational_team).
top_nint25How many of the season's best teams by the published adj_em are vs_top (default 25).
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id, family, split) with the columns of sportsdataverse.nba.nba_situational.nba_situational_team; team_id is the ESPN team id (Int64). A non-D1 opponent gets no row. 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_idInt64ESPN team id of the team (Int64).
familyStringThe split family: all, clutch, period, half, garbage, score, venue, opponent or play_type (college has no second-chance flag, so no chance family); within a family the splits add up to the all row.
splitStringThe split: all; clutch / not_clutch; p1..p4 / ot (p1, p2 for halves); h1 / h2 / ot; garbage_time / not_garbage_time; leading / tied / trailing; home / away / neutral; vs_top / vs_rest; transition / half_court.
gamesInt64Games with at least one possession in the split (does not add up across a family).
minutesFloat64Game-clock minutes of the split's possessions (seconds / 60).
secondsFloat64Game-clock seconds of the split's possessions: each possession's start clock minus its end clock.
possInt64Offensive possessions in the split.
opp_possInt64Defensive possessions in the split.
ptsInt64Points scored on the offensive possessions.
opp_ptsInt64Points allowed on the defensive possessions.
plus_minusInt64Plus-minus over the split: pts - opp_pts.
off_rtgFloat64Offensive rating: pts per 100 poss; null with no offensive possessions.
def_rtgFloat64Defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions.
net_rtgFloat64Net rating: off_rtg - def_rtg; null when either is null.
off_rtg_nInt64Sample size of off_rtg: poss.
def_rtg_nInt64Sample size of def_rtg: opp_poss.
net_rtg_nInt64Sample size of net_rtg: poss + opp_poss.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens", or top_n is below 1.

Example

from sportsdataverse.mbb.mbb_situational import mbb_situational_team
mbb_situational_team(2026).filter(split="vs_top").sort("net_rtg", descending=True).head()

mbb_situational_team_games​

mbb_situational_team_games(seasons: 'int | list[int]', *, league: 'str' = 'mens', top_n: 'int' = 25, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

College team splits by situation, one game at a time: mbb_situational_team per game.

The same possessions and labels, grouped by game too, so a team-season's rows of a split add up to its mbb_situational_team row (games, seconds, poss, opp_poss, pts, opp_pts). The opponent family keeps the season's top top_n.

The all and garbage rows also carry the team's box counts in that split (the COUNT_COLUMNS: fga, fgm, fg3a, fg3m, fta, ftm, oreb, dreb, tov), from the season's ncaa_{mbb,wbb}_pbp events through ncaa_team_game_counts, so a page can show shooting and the four factors with garbage time out without summing the events itself. They count the events by the team that made them, so their points (2 * fgm + fg3m + ftm) can differ from pts, which the possessions release credits to the team with the ball, by a basket in some games. The other families' rows have null counts, as does a game the pbp release lacks.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26).
leaguestr'mens'"mens" or "womens" (sportsdataverse.wbb.wbb_situational.wbb_situational_team_games).
top_nint25As mbb_situational_team.
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id, game_id, family, split), the columns of mbb_situational_team plus game_id (the stats.ncaa.org contest id) and the nine COUNT_COLUMNS (Int64); games is 1. A split the team did not play in the game has no row. 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_idInt64ESPN team id of the team (Int64).
game_idStringstats.ncaa.org contest id.
familyStringThe split family: all, clutch, period, half, garbage, score, venue, opponent or play_type (college has no second-chance flag, so no chance family); within a family the splits add up to the all row.
splitStringThe split: all; clutch / not_clutch; p1..p4 / ot (p1, p2 for halves); h1 / h2 / ot; garbage_time / not_garbage_time; leading / tied / trailing; home / away / neutral; vs_top / vs_rest; transition / half_court.
gamesInt641: the row is one game (summed over a team-season's rows it is the season row's games).
minutesFloat64Game-clock minutes of the split's possessions (seconds / 60).
secondsFloat64Game-clock seconds of the split's possessions: each possession's start clock minus its end clock.
possInt64Offensive possessions in the split.
opp_possInt64Defensive possessions in the split.
ptsInt64Points scored on the offensive possessions.
opp_ptsInt64Points allowed on the defensive possessions.
plus_minusInt64Plus-minus over the split: pts - opp_pts.
off_rtgFloat64Offensive rating: pts per 100 poss; null with no offensive possessions.
def_rtgFloat64Defensive rating: opp_pts per 100 opp_poss; null with no defensive possessions.
net_rtgFloat64Net rating: off_rtg - def_rtg; null when either is null.
off_rtg_nInt64Sample size of off_rtg: poss.
def_rtg_nInt64Sample size of def_rtg: opp_poss.
net_rtg_nInt64Sample size of net_rtg: poss + opp_poss.
fgaInt64Field-goal attempts in the split: the team's shot_value 2 and 3 events in the ncaa pbp; null on the families other than all and garbage.
fgmInt64Made field goals in the split (event_result made); null on the families other than all and garbage.
fg3aInt64Three-point attempts in the split (shot_value 3); null on the families other than all and garbage.
fg3mInt64Made threes in the split; null on the families other than all and garbage.
ftaInt64Free-throw attempts in the split (shot_value 1); null on the families other than all and garbage.
ftmInt64Made free throws in the split; null on the families other than all and garbage.
orebInt64Offensive rebounds in the split (Offensive Rebound events, team rebounds included); null on the families other than all and garbage.
drebInt64Defensive rebounds in the split (Defensive Rebound events, team rebounds included); null on the families other than all and garbage.
tovInt64Turnovers in the split (Turnover events, team turnovers included); null on the families other than all and garbage.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens", or top_n is below 1.

Example

from sportsdataverse.mbb.mbb_situational import mbb_situational_team_games
mbb_situational_team_games(2026).filter(family="score").head()

mbb_strength_of_schedule​

mbb_strength_of_schedule(seasons: 'list[int]', *, as_of_date: 'datetime.date | None' = None, league: 'str' = 'mens', ineligible: 'Iterable[str] | None' = None, return_as_pandas: 'bool' = False) -> 'pl.DataFrame | pd.DataFrame'

The daily strength_of_schedule table: records, SoS, quad résumé, WAB, RPI and a NET estimate.

Loads the released ESPN schedule and team box per season and builds ~sportsdataverse.mbb.mbb_college_season.season_resume from the games strictly before as_of_date: opponent-adjusted ratings, SoS (mean opponent AdjEM), WAB, the NCAA Quad 1-4 record (opponents ranked by the NET estimate), the NCAA RPI (25% WP / 50% OWP / 25% OOWP, location-weighted WP) and the NET-style estimate (0.8 * z(AdjEM) + 0.2 * z(WAB)). Division I teams only; RPI, SoS, WAB and the quads count Division I games only.

Parameters

ParameterTypeDefaultDescription
seasonslist[int]Seasons to compute (e.g. [2024]).
as_of_datedate | NoneNoneOnly use games strictly before this date; None uses every completed game. Applies to every season in seasons.
leaguestr'mens'"mens" or "womens".
ineligibleIterable[str] | NoneNoneTeam ids barred from the NCAA tournament (sets eligible); None (default) reads the bundled list for each season.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.

Returns

One row per Division I (season, team_id), best net_estimate_rank first. The _rank / _pct columns (1 is best, average ties, within the season) and _n (the Division I games behind each number; all games for adj_em) follow BB-D2's league-context grammar.

col_nametypedescription
seasonInt64Season, named by its end year (2024 is 2023-24).
as_of_dateDateThe as-of date: only games strictly before it count as played. Null when every completed game is used.
team_idStringESPN team id (Utf8).
teamStringTeam (ESPN location name).
conference_idStringESPN conference id, read off the schedule (Utf8).
conferenceStringConference short name. Null for independents, which get no auto-bid.
eligibleBooleanFalse for a team the caller listed as barred from the NCAA tournament (reclassifying to Division I, a postseason ban). It counts in every rating and résumé but gets no bid.
winsInt64Wins in played games, against every opponent (non-Division I included).
lossesInt64Losses in played games, against every opponent.
conf_winsInt64Regular-season conference wins (conference tournaments and multi-team events excluded).
conf_lossesInt64Regular-season conference losses.
gamesInt64Games behind the ratings (every played game with a usable box score).
adj_oFloat64Opponent-adjusted offensive efficiency: points per 100 possessions (mbb_team_ratings).
adj_dFloat64Opponent-adjusted defensive efficiency: points allowed per 100 possessions.
adj_emFloat64Adjusted efficiency margin, adj_o - adj_d.
adj_em_zFloat64adj_em z-scored over Division I within the season.
sosFloat64Strength of schedule: mean opponent adj_em over Division I games.
wabFloat64Wins above bubble: Division I wins minus a bubble-quality team's expected wins against the same schedule and venues.
quad1_wInt64Quad 1 wins over Division I opponents, by the opponent's NET-estimate rank and the venue (NCAA ranges, men's and women's differ).
quad1_lInt64Quad 1 losses to Division I opponents, by the same opponent rank and venue ranges.
quad2_wInt64Quad 2 wins over Division I opponents, by the opponent's NET-estimate rank and the venue (NCAA ranges, men's and women's differ).
quad2_lInt64Quad 2 losses to Division I opponents, by the same opponent rank and venue ranges.
quad3_wInt64Quad 3 wins over Division I opponents, by the opponent's NET-estimate rank and the venue (NCAA ranges, men's and women's differ).
quad3_lInt64Quad 3 losses to Division I opponents, by the same opponent rank and venue ranges.
quad4_wInt64Quad 4 wins over Division I opponents, by the opponent's NET-estimate rank and the venue (NCAA ranges, men's and women's differ).
quad4_lInt64Quad 4 losses to Division I opponents, by the same opponent rank and venue ranges.
quality_winsInt64Quad 1 plus Quad 2 wins.
rpi_gamesInt64Division I games behind the RPI.
rpi_wpFloat64RPI winning percentage over Division I games, location weighted: a home win 0.6, a road win 1.4, a home loss 1.4, a road loss 0.6, neutral 1.0 (men's from 2004-05, women's from 2011-12).
rpi_owpFloat64Opponents' winning percentage: each opponent's unweighted Division I record without its games against this team, averaged over this team's games.
rpi_oowpFloat64Opponents' opponents' winning percentage: the opponents' rpi_owp averaged over this team's games.
rpiFloat64NCAA Rating Percentage Index: 0.25 * rpi_wp + 0.50 * rpi_owp + 0.25 * rpi_oowp.
net_estimateFloat64NET-style score: 0.8 * z(adj_em) + 0.2 * z(wab) within the season (the NET's efficiency and results halves; weights fitted to the men's 2024 NET). Higher is better.
adj_em_rankFloat64Rank of adj_em within the season among Division I teams: 1 is best, average ties.
adj_em_pctFloat64Percentile of adj_em within the season: 100 * (n + 1 - rank) / (n + 1).
adj_em_nInt64Sample size of adj_em: the games behind the ratings.
sos_rankFloat64Rank of sos (1 = hardest schedule) within the season among Division I teams: 1 is best, average ties.
sos_pctFloat64Percentile of sos within the season: 100 * (n + 1 - rank) / (n + 1).
sos_nInt64Sample size of sos: the team's Division I games.
wab_rankFloat64Rank of wab within the season among Division I teams: 1 is best, average ties.
wab_pctFloat64Percentile of wab within the season: 100 * (n + 1 - rank) / (n + 1).
wab_nInt64Sample size of wab: the team's Division I games.
rpi_rankFloat64Rank of rpi within the season among Division I teams: 1 is best, average ties.
rpi_pctFloat64Percentile of rpi within the season: 100 * (n + 1 - rank) / (n + 1).
rpi_nInt64Sample size of rpi: the team's Division I games.
net_estimate_rankFloat64Rank of net_estimate (the NET-estimate ranking the quads use) within the season among Division I teams: 1 is best, average ties.
net_estimate_pctFloat64Percentile of net_estimate within the season: 100 * (n + 1 - rank) / (n + 1).
net_estimate_nInt64Sample size of net_estimate: the team's Division I games.

Example

from sportsdataverse.mbb import mbb_strength_of_schedule
resume = mbb_strength_of_schedule([2024])

# Pipeline next step (one line)

resume.sort("rpi_rank").head(25)

mbb_team_game_four_factors​

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

College per team and game: the four factors in points against the season's league-average offense.

pts_vs_exp (play-by-play points less a league-average offense on the same counted possessions) split exactly into shooting_pts, turnover_pts, rebounding_pts, free_throw_pts and residual_pts. The factors come from the NCAA team box, the points and possessions from the play-by-play, so the residual is the possession count's distance from the box estimate plus the play-by-play points' from the box's, each beyond the league's. The prices and the residual's formula are in sportsdataverse._common.team_season_rates.team_game_four_factors; every league value is the season's, pooled over the D-I games of the releases, and is on each row.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2025 is 2024-25).
leaguestr'mens'"mens" or "womens" (sportsdataverse.wbb.wbb_team_season_rates.wbb_team_game_four_factors).
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id, game_id). team_id is the ESPN team id (Int64), game_id the stats.ncaa.org contest id. poss / pts are the team's counted possessions and points, exp_pts is lg_ppp * poss and pts_vs_exp the difference; the five *_pts columns add up to it (null when the game has no team-box row). lg_ppp, lg_efg_pct, lg_tov_pct, lg_orb_pct, lg_ft_rate, lg_ft_pct and chance_pts are the season's league values. A non-D1 opponent gets no row. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (2025 is 2024-25).
team_idInt64ESPN team id (a non-D1 opponent gets no row).
game_idStringThe stats.ncaa.org contest id.
possInt64The team's offensive possessions in the game, counted from possession rows.
ptsInt64Points scored on the team's offensive possessions in the game. From the play-by-play.
exp_ptsFloat64Points a league-average offense scores on the team's counted possessions, lg_ppp x poss.
pts_vs_expFloat64Points above (+) or below (-) a league-average offense on the same possessions, pts - exp_pts. The four *_pts factors and residual_pts add up to it exactly; they are null (and do not) when a league value they use has a zero denominator or the game has no counts.
shooting_ptsFloat64Points from shooting: 2 x (eFG% - lg_efg_pct) x FGA, the same shots above a league-average shooter, plus chance_pts x lg_orb_pct x the rebound chances above the league's per FGA: the misses a league-average offense gets back.
turnover_ptsFloat64Points from turnovers: (lg_tov_pct x poss - TOV) x chance_pts, the turnovers saved, each a chance.
rebounding_ptsFloat64Points from offensive rebounding: (OREB - lg_orb_pct x (OREB + opponent DREB)) x chance_pts, the extra offensive rebounds on the team's own rebound chances, each a new chance.
free_throw_ptsFloat64Points from free throws: (FTA - lg_ft_rate x FGA) x (lg_ft_pct - 0.44 x chance_pts), the extra free throws at a league-average make less the share of a chance each uses, plus FTM - lg_ft_pct x FTA, the makes above league FT%.
residual_ptsFloat64The remainder, exactly (pts - box_pts - FGA x the league's pooled (pts - box_pts) / FGA) + chance_pts x (box_poss - poss - FGA x the league's pooled (box_poss - poss) / FGA), box_pts = 2 FGM + 3PM + FTM, box_poss = FGA - OREB + TOV + 0.44 FTA: the play-by-play points' and possessions' distance from the team box beyond the league's. Sums to zero over the league.
lg_pppFloat64League points per counted possession in the season, over the priced team-games (those with all their counts).
lg_efg_pctFloat64League effective field-goal percentage in the season, (FGM + 0.5 3PM) / FGA over the priced team-games (those with all their counts).
lg_tov_pctFloat64League turnovers per counted possession in the season, over the priced team-games (those with all their counts).
lg_orb_pctFloat64League offensive-rebound percentage in the season, OREB / (OREB + opponent DREB) over the priced team-games (those with all their counts).
lg_ft_rateFloat64League free-throw rate in the season, FTA / FGA over the priced team-games (those with all their counts).
lg_ft_pctFloat64League free-throw percentage in the season, FTM / FTA over the priced team-games (those with all their counts).
chance_ptsFloat64Points a chance is worth, lg_ppp / (1 - lg_tov_pct): a possession that does not end in a turnover. The price of a turnover saved and of an extra offensive rebound.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens".

Example

from sportsdataverse.mbb.mbb_team_season_rates import mbb_team_game_four_factors
books = mbb_team_game_four_factors(2025)
books.sort("pts_vs_exp", descending=True).head()

mbb_team_game_possessions​

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

Per team and game: the college possession counts behind mbb_team_season_rates.

The season table's poss / opp_poss / pts / opp_pts one game at a time, from the same possessions, so a team-season's rows of a split add up to its season row exactly (their count is games). Rate any set of games the same way: sum the rows, then divide once (off_rtg = 100 * pts / poss; tempo 40 * 60 * (poss + opp_poss) / 2 / seconds).

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2025 is 2024-25).
leaguestr'mens'"mens" or "womens" (sportsdataverse.wbb.wbb_team_season_rates.wbb_team_game_possessions).
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id, game_id, split): a game has an all row, a home or away row (neither at a neutral site) and, when it has clutch possessions, close and clutch rows. team_id is the ESPN team id (Int64), game_id the stats.ncaa.org contest id. poss / opp_poss are the team's offensive / defensive possessions, pts / opp_pts their points and seconds the game clock they used. A non-D1 opponent gets no row. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (2025 is 2024-25).
team_idInt64ESPN team id. Non-D1 opponents have none and get no row.
game_idStringstats.ncaa.org contest id. The game this row's possessions are from.
splitStringThe season table's split this game is in: all (every game); home or away (neither at a neutral site); close and clutch when the game has clutch possessions. A team-season's rows of a split add up to its mbb_team_season_rates row.
possInt64Offensive possessions in the split, counted from possession rows.
opp_possInt64Defensive possessions in the split (the opponents' offensive possessions).
ptsInt64Points scored on the team's offensive possessions in the split.
opp_ptsInt64Points allowed on the team's defensive possessions in the split.
secondsFloat64Game-clock seconds the team's possessions in the split used; pace over a set of games is regulation minutes x 60 x (poss + opp_poss) / 2 / summed seconds.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens".

Example

from sportsdataverse.mbb.mbb_team_season_rates import mbb_team_game_possessions
games = mbb_team_game_possessions(2025).filter(split="all")

mbb_team_luck​

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

College luck and close-game record: Pythagorean expected wins vs actual wins, and close-game W-L.

One row per team and season. exp_wins is the Pythagorean expectation on the season's final scores, games * pts^x / (pts^x + opp_pts^x), with the exponent x fitted per league on past seasons (~sportsdataverse._common.team_luck.PYTHAG_EXPONENT). luck_wins is wins - exp_wins. A close game is one within 5 points at the start of a possession in play in the last 5:00 of the 2nd half (4th quarter, women's, from 2016) or overtime: one that starts there, or starts before 5:00 and ends after it.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2025 is 2024-25).
leaguestr'mens'"mens" or "womens" (sportsdataverse.wbb.wbb_team_luck.wbb_team_luck).
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id); team_id is the ESPN team id (Int64). games, wins, losses, pts and opp_pts are from ESPN's completed games (postseason included); win_pct, pythag_win_pct, exp_wins and luck_wins (wins - exp_wins) follow. pbp_games counts the games with published NCAA possessions, and close_games, close_wins, close_losses and close_win_pct (null with no close game) are the close games among them. pythag_win_pct, luck_wins and close_win_pct have <m>_rank (1 = highest), <m>_pct (the Weibull percentile) and <m>_n (games, or close games); ranks are within the season, among teams with at least half the most games (which leaves out the non-D1 opponents; close_win_pct also needs possessions for half of them and five close games), and null under five teams. Empty input returns that schema with zero rows.

col_nametypedescription
seasonInt64Season, named by the year it ends (2025 is 2024-25).
team_idInt64ESPN team id. Non-D1 opponents get rows of their own (a game or two) and no ranks.
gamesInt64Games in the season's completed ESPN games, postseason included.
winsInt64Wins in the season's completed ESPN games, postseason included.
lossesInt64Losses in the season's completed ESPN games, postseason included.
ptsInt64Points scored in those games (final scores).
opp_ptsInt64Points allowed in those games (final scores).
win_pctFloat64Win fraction: wins divided by games, from the final scores.
pythag_win_pctFloat64Pythagorean win fraction: pts^x / (pts^x + opp_pts^x), x = PYTHAG_EXPONENT['mbb'] (PYTHAG_EXPONENT['wbb'] with league='womens'), fitted on past seasons by tools/fit_team_luck_pythag.py.
exp_winsFloat64Expected wins: pythag_win_pct * games.
luck_winsFloat64Luck in wins: wins minus exp_wins. Positive means the team won more games than its scoring says it should have.
pbp_gamesInt64Games with published possessions (ncaa_mbb_possessions); close_games is counted among these. A game whose late possessions are missing from the release counts as not close.
close_gamesInt64Close games: at least one possession in play with 5:00 or less left (starting there, or starting before 5:00 and ending after it) in the 2nd half (the 4th quarter for league='womens' from 2016) or an overtime, the score within 5 as that possession starts (stats.nba.com's clutch window; BB-D3's close split). The margin is the running sum of the possessions' points, so it can drift from the scoreboard: NBA 2025-26 agrees with an independent ESPN play-by-play recount on 1215 of 1229 games.
close_winsInt64Wins in close games.
close_lossesInt64Losses in close games.
close_win_pctFloat64close_wins / close_games; null with no close game.
pythag_win_pct_rankFloat64Rank of pythag_win_pct within the season (the highest value ranks 1; ties average), among teams that played at least half the most games any team played in the season; null for a non-qualifier, a null value, or fewer than five qualifiers, or when every qualifier has the same value.
luck_wins_rankFloat64Rank of luck_wins within the season (the highest value ranks 1; ties average), among teams that played at least half the most games any team played in the season; null for a non-qualifier, a null value, or fewer than five qualifiers, or when every qualifier has the same value.
close_win_pct_rankFloat64Rank of close_win_pct within the season (the highest value ranks 1; ties average), among teams that played at least half the most games any team played in the season, have possessions for at least half their games and played at least five close games (MIN_CLOSE_GAMES); null otherwise, for a null value, or with fewer than five qualifiers, or when every qualifier has the same value.
pythag_win_pct_pctFloat64Percentile of pythag_win_pct within the season among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked, so the best team is under 100 and nobody is 0; null when the rank is null.
luck_wins_pctFloat64Percentile of luck_wins within the season among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked, so the best team is under 100 and nobody is 0; null when the rank is null.
close_win_pct_pctFloat64Percentile of close_win_pct within the season among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked, so the best team is under 100 and nobody is 0; null when the rank is null.
pythag_win_pct_nInt64Sample size of pythag_win_pct: games.
luck_wins_nInt64Sample size of luck_wins: games.
close_win_pct_nInt64Sample size of close_win_pct: close games.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens".
SeasonNotFoundErrorFor a season before 2010, the first with NCAA possessions.

Example

from sportsdataverse.mbb.mbb_team_luck import mbb_team_luck
luck = mbb_team_luck(2025)
luck.sort("luck_wins", descending=True).select("team_id", "wins", "exp_wins", "luck_wins").head()

mbb_team_season_flow​

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

College game flow per team and season, with ranks, percentiles and _n.

Parameters

ParameterTypeDefaultDescription
seasonsint | list[int]A season or list of seasons, named by the year it ends (2026 is 2025-26).
leaguestr'mens'"mens" or "womens" (sportsdataverse.wbb.wbb_game_flow.wbb_team_season_flow).
return_as_pandasboolFalseReturn a pandas frame instead of polars.

Returns

One row per (season, team_id) with the columns of sportsdataverse.nba.nba_game_flow.nba_team_season_flow; ranks are among teams with at least half the season's most games (which leaves out the non-D1 opponents). 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_idInt64ESPN team id; a non-D1 opponent has none and gets no row.
gamesInt64Games played (completed games of the season type).
winsInt64Games the team won among its completed games of the season type (pts > opp_pts).
trail_pctFloat64Share of the team's game clock spent behind (sum trail_sec / sum game_seconds).
tied_pctFloat64Share of the team's game clock spent tied.
lead_changes_pgFloat64Lead changes per game.
times_tied_pgFloat64Times tied per game.
largest_leadInt64The team's biggest lead of the season.
largest_comebackInt64The biggest deficit the team overcame in a win this season (0 if none).
max_runInt64The team's biggest n-0 run of the season.
runs_10Int64The team's runs of 10 or more unanswered points, summed over the season.
opp_runs_10Int64The opponents' runs of 10 or more unanswered points against the team, summed.
def_possInt64Defensive possessions, summed.
stopsInt64Stops (scoreless defensive possessions), summed.
killsInt64Kills (three straight stops), summed.
double_killsInt64Double kills (six straight stops), summed.
avg_marginFloat64Game control: the score margin averaged over the season's game clock.
avg_wpFloat64Game control: the in-game win probability averaged over the season's game clock.
lead_pctFloat64Share of the team's game clock spent ahead (sum lead_sec / sum game_seconds).
runs_10_pgFloat64The team's 10-0 (or better) runs per game.
opp_runs_10_pgFloat64The opponents' 10-0 (or better) runs against the team per game.
avg_longest_drought_secFloat64The team's longest scoring drought, in seconds, averaged over its games.
stop_pctFloat64stops / def_poss; null with no possessions.
kills_pgFloat64Kills per game.
double_kills_pgFloat64Double kills per game.
kills_per_100Float64Kills per 100 defensive possessions; null with no possessions.
avg_margin_rankFloat64Rank of avg_margin within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
avg_wp_rankFloat64Rank of avg_wp within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
lead_pct_rankFloat64Rank of lead_pct within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
runs_10_pg_rankFloat64Rank of runs_10_pg within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
opp_runs_10_pg_rankFloat64Rank of opp_runs_10_pg within the season (the lowest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
avg_longest_drought_sec_rankFloat64Rank of avg_longest_drought_sec within the season (the lowest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
stop_pct_rankFloat64Rank of stop_pct within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
kills_pg_rankFloat64Rank of kills_pg within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
double_kills_pg_rankFloat64Rank of double_kills_pg within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
kills_per_100_rankFloat64Rank of kills_per_100 within the season (the highest value ranks 1; ties average), among teams with at least half the season's most games; null for a non-qualifier, a null value, or fewer than five qualifiers.
avg_margin_pctFloat64Percentile of avg_margin among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
avg_wp_pctFloat64Percentile of avg_wp among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
lead_pct_pctFloat64Percentile of lead_pct among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
runs_10_pg_pctFloat64Percentile of runs_10_pg among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
opp_runs_10_pg_pctFloat64Percentile of opp_runs_10_pg among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
avg_longest_drought_sec_pctFloat64Percentile of avg_longest_drought_sec among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
stop_pct_pctFloat64Percentile of stop_pct among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
kills_pg_pctFloat64Percentile of kills_pg among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
double_kills_pg_pctFloat64Percentile of double_kills_pg among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
kills_per_100_pctFloat64Percentile of kills_per_100 among the same qualified teams: 100 * (n + 1 - rank) / (n + 1), n the number ranked; null when the rank is null.
avg_margin_nInt64Sample size of avg_margin: games.
avg_wp_nInt64Sample size of avg_wp: the games with a win probability.
lead_pct_nInt64Sample size of lead_pct: games.
runs_10_pg_nInt64Sample size of runs_10_pg: games.
opp_runs_10_pg_nInt64Sample size of opp_runs_10_pg: games.
avg_longest_drought_sec_nInt64Sample size of avg_longest_drought_sec: games.
stop_pct_nInt64Sample size of stop_pct: the teams defensive possessions.
kills_pg_nInt64Sample size of kills_pg: the games with published possessions.
double_kills_pg_nInt64Sample size of double_kills_pg: the games with published possessions.
kills_per_100_nInt64Sample size of kills_per_100: the teams defensive possessions.
kills_per75Float64Kills per 75 defensive possessions: 0.75 * kills_per_100 (BB-G8's per-75 basis); null with no possessions.
kills_per75_rankFloat64Rank of kills_per75: kills_per_100_rank, copied (scaling by 0.75 keeps the order).
kills_per75_pctFloat64Percentile of kills_per75: kills_per_100_pct, copied (scaling by 0.75 keeps the order).
kills_per75_nInt64Sample size of kills_per75: kills_per_100_n, copied.

Raises

ExceptionDescription
ValueErrorIf league is not "mens" or "womens".

Example

from sportsdataverse.mbb.mbb_game_flow import mbb_team_season_flow
mbb_team_season_flow(2026).sort("avg_wp_rank").head()