Skip to main content

Women's college basketball — additional Python functions — Analytics: wbb_team–weighted_avg

wbb_team_strength​

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

Women's college team strength: adjusted ratings, SOS, SOV, tempo and the four factors.

Delegates to sportsdataverse.mbb.mbb_team_strength.mbb_team_strength with league="womens". adj_*_rtg are the published wbb_ratings; adj_*_rtg_ridge the possession ridge on the ncaa_wbb_possessions release.

Parameters

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

Returns

One row per (season, team_id): games, wins, losses, poss, opp_poss, pts, opp_pts, both sets of adjusted ratings, sos, sov, the BB-D3 rates and their _rank / _pct / _n. See the mbb core for the definitions.

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.
gamesInt64Games with at least one possession in the season (from the possession release).
winsInt64Wins in the season's completed ESPN games.
lossesInt64Losses in the season's completed ESPN games.
possInt64Offensive possessions in the season, counted from possession rows.
opp_possInt64Defensive possessions in the season (the opponents' offensive possessions).
ptsInt64Points scored on the team's offensive possessions in the season.
opp_ptsInt64Points allowed on the team's defensive possessions in the season.
adj_off_rtgFloat64Adjusted offensive rating: points per 100 possessions against an average defense, from the published college ratings (adj_o, the mbb_team_ratings fixed point).
adj_def_rtgFloat64Adjusted defensive rating: points allowed per 100 possessions against an average offense, from the published college ratings (adj_d); lower is better.
adj_net_rtgFloat64Adjusted net rating: adj_off_rtg minus adj_def_rtg.
sosFloat64Strength of schedule: the mean adj_net_rtg of the opponents of the team's completed games, one weight per game (an opponent met four times counts four times). Opponents with no rating are left out.
sovFloat64Strength of victory: the mean adj_net_rtg of the opponents the team beat, one weight per win; null with no win.
off_rtgFloat64Offensive rating: points scored per 100 offensive possessions.
def_rtgFloat64Defensive rating: points allowed per 100 defensive possessions.
net_rtgFloat64Net rating: off_rtg minus def_rtg.
paceFloat64Pace: possessions per 40 minutes, the mean of poss and opp_poss over the game clock those possessions used.
efg_pctFloat64Effective field-goal percentage, (FGM + 0.5 * 3PM) / FGA, as a fraction. Game-level, from the NCAA team box.
tov_pctFloat64Turnovers per offensive possession, as a fraction. Game-level, from the NCAA team box.
orb_pctFloat64Offensive rebound rate: offensive rebounds over offensive-rebound chances (own OREB plus the defense's DREB), as a fraction. Game-level, from the NCAA team box.
ft_rateFloat64Free-throw rate, FTA / FGA. Game-level, from the NCAA team box.
opp_efg_pctFloat64Opponents' effective field-goal percentage, (FGM + 0.5 * 3PM) / FGA, as a fraction. Game-level, from the NCAA team box.
opp_tov_pctFloat64Opponents' turnovers per possession (turnovers forced), as a fraction. Game-level, from the NCAA team box.
opp_orb_pctFloat64Opponents' offensive rebound rate, as a fraction (one minus the team's defensive rebound rate). Game-level, from the NCAA team box.
opp_ft_rateFloat64Opponents' free-throw rate, FTA / FGA. Game-level, from the NCAA team box.
adj_off_rtg_rankFloat64Rank of adj_off_rtg 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.
adj_def_rtg_rankFloat64Rank of adj_def_rtg within the season (the lowest 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.
adj_net_rtg_rankFloat64Rank of adj_net_rtg 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.
sos_rankFloat64Rank of sos within the season (the highest value ranks 1; the hardest schedule 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.
sov_rankFloat64Rank of sov within the season (the highest value ranks 1; the strongest wins rank 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.
off_rtg_rankFloat64Rank of off_rtg 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, whose off_rtg_n is at least 130 offensive possessions (the sample at which the rate is half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
def_rtg_rankFloat64Rank of def_rtg within the season (the lowest value ranks 1; ties average), among teams that played at least half the most games any team played in the season, whose def_rtg_n is at least 470 defensive possessions (the sample at which the rate is half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
net_rtg_rankFloat64Rank of net_rtg 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, whose net_rtg_n is at least 360 possessions (offense plus defense) (the sample at which the rate was, on the fit seasons, half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
pace_rankFloat64Rank of pace within the season (the highest value ranks 1; pace has no better direction; ties average), among teams that played at least half the most games any team played in the season, whose pace_n is at least 3 games (the sample at which the rate is half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
efg_pct_rankFloat64Rank of efg_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, whose efg_pct_n is at least 230 field-goal attempts (the sample at which the rate is half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
tov_pct_rankFloat64Rank of tov_pct within the season (the lowest value ranks 1; ties average), among teams that played at least half the most games any team played in the season, whose tov_pct_n is at least 210 offensive possessions (the sample at which the rate is half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
orb_pct_rankFloat64Rank of orb_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, whose orb_pct_n is at least 160 offensive-rebound chances (the sample at which the rate is half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
ft_rate_rankFloat64Rank of ft_rate 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, whose ft_rate_n is at least 550 field-goal attempts (the sample at which the rate is half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
opp_efg_pct_rankFloat64Rank of opp_efg_pct within the season (the lowest value ranks 1; ties average), among teams that played at least half the most games any team played in the season, whose opp_efg_pct_n is at least 600 opponent field-goal attempts (the sample at which the rate was, on the fit seasons, half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
opp_tov_pct_rankFloat64Rank of opp_tov_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, whose opp_tov_pct_n is at least 300 defensive possessions (the sample at which the rate was, on the fit seasons, half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
opp_orb_pct_rankFloat64Rank of opp_orb_pct within the season (the lowest value ranks 1; ties average), among teams that played at least half the most games any team played in the season, whose opp_orb_pct_n is at least 240 opponent offensive-rebound chances (the sample at which the rate was, on the fit seasons, half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
opp_ft_rate_rankFloat64Rank of opp_ft_rate within the season (the lowest value ranks 1; ties average), among teams that played at least half the most games any team played in the season, whose opp_ft_rate_n is at least 420 opponent field-goal attempts (the sample at which the rate was, on the fit seasons, half signal, rate_gates); null for a non-qualifier, a sample under that gate, a null rate, or fewer than five qualifiers.
adj_off_rtg_pctFloat64Percentile of adj_off_rtg 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.
adj_def_rtg_pctFloat64Percentile of adj_def_rtg 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.
adj_net_rtg_pctFloat64Percentile of adj_net_rtg 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.
sos_pctFloat64Percentile of sos 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.
sov_pctFloat64Percentile of sov 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.
off_rtg_pctFloat64Percentile of off_rtg 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.
def_rtg_pctFloat64Percentile of def_rtg 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.
net_rtg_pctFloat64Percentile of net_rtg 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.
pace_pctFloat64Percentile of pace 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.
efg_pct_pctFloat64Percentile of efg_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.
tov_pct_pctFloat64Percentile of tov_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.
orb_pct_pctFloat64Percentile of orb_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.
ft_rate_pctFloat64Percentile of ft_rate 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.
opp_efg_pct_pctFloat64Percentile of opp_efg_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.
opp_tov_pct_pctFloat64Percentile of opp_tov_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.
opp_orb_pct_pctFloat64Percentile of opp_orb_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.
opp_ft_rate_pctFloat64Percentile of opp_ft_rate 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.
adj_off_rtg_nInt64Sample size of adj_off_rtg: the team's offensive possessions in the season.
adj_def_rtg_nInt64Sample size of adj_def_rtg: the team's defensive possessions in the season.
adj_net_rtg_nInt64Sample size of adj_net_rtg: the team's offensive plus defensive possessions in the season.
sos_nInt64Sample size of sos: the completed games against a rated opponent.
sov_nInt64Sample size of sov: the wins against a rated opponent.
off_rtg_nInt64Sample size of off_rtg: the team's offensive possessions in the season.
def_rtg_nInt64Sample size of def_rtg: the team's defensive possessions in the season.
net_rtg_nInt64Sample size of net_rtg: the team's offensive plus defensive possessions in the season.
pace_nInt64Sample size of pace: the game clock the season's possessions used, in regulation games (48 minutes, 40 in the WNBA and college), rounded: about the games played, overtime adding a little.
efg_pct_nInt64Sample size of efg_pct: the team's field-goal attempts in the season, 0 when the rate is null.
tov_pct_nInt64Sample size of tov_pct: the NCAA team box's possessions (o_poss) in the season, 0 when the rate is null.
orb_pct_nInt64Sample size of orb_pct: the team's offensive-rebound chances in the season, 0 when the rate is null.
ft_rate_nInt64Sample size of ft_rate: the team's field-goal attempts in the season, 0 when the rate is null.
opp_efg_pct_nInt64Sample size of opp_efg_pct: the opponents' field-goal attempts in the season, 0 when the rate is null.
opp_tov_pct_nInt64Sample size of opp_tov_pct: the opponents' NCAA team-box possessions in the season, 0 when the rate is null.
opp_orb_pct_nInt64Sample size of opp_orb_pct: the opponents' offensive-rebound chances in the season, 0 when the rate is null.
opp_ft_rate_nInt64Sample size of opp_ft_rate: the opponents' field-goal attempts in the season, 0 when the rate is null.
adj_off_rtg_ridgeFloat64Adjusted offensive rating, possession-ridge method: points per 100 possessions against an average Division I defense on a neutral court. The NBA / WNBA ridge (possession_ridge_ratings) on the ncaa_wbb_possessions release, penalty COLLEGE_RIDGE_LAMBDA, home court fitted and ESPN neutral sites; possessions against a non-Division I opponent left out. Published beside the fixed-point adj_off_rtg, which it does not replace.
adj_def_rtg_ridgeFloat64Adjusted defensive rating, possession-ridge method: points allowed per 100 possessions against an average Division I offense on a neutral court; lower is better.
adj_net_rtg_ridgeFloat64Adjusted net rating, possession-ridge method: adj_off_rtg_ridge minus adj_def_rtg_ridge.
adj_off_rtg_ridge_rankFloat64Rank of adj_off_rtg_ridge 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.
adj_def_rtg_ridge_rankFloat64Rank of adj_def_rtg_ridge within the season (the lowest 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.
adj_net_rtg_ridge_rankFloat64Rank of adj_net_rtg_ridge 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.
adj_off_rtg_ridge_pctFloat64Percentile of adj_off_rtg_ridge 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.
adj_def_rtg_ridge_pctFloat64Percentile of adj_def_rtg_ridge 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.
adj_net_rtg_ridge_pctFloat64Percentile of adj_net_rtg_ridge 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.
adj_off_rtg_ridge_nInt64Sample size of adj_off_rtg_ridge: the team's offensive possessions in the season, counting any against a non-Division I opponent that the fit leaves out.
adj_def_rtg_ridge_nInt64Sample size of adj_def_rtg_ridge: the team's defensive possessions in the season, counting any against a non-Division I opponent that the fit leaves out.
adj_net_rtg_ridge_nInt64Sample size of adj_net_rtg_ridge: the team's offensive plus defensive possessions in the season, counting any against a non-Division I opponent that the fit leaves out.

Example

from sportsdataverse.wbb import wbb_team_strength
wbb_team_strength(2025).sort("adj_net_rtg_rank").head()

weighted_avg​

weighted_avg(mutable_acc: 'LineupStatSet', obj: 'LineupStatSet') -> 'None'

Merge obj into mutable_acc with possession weighting.

Faithful port of LineupUtils.weightedAvg (LineupUtils.ts:645). Mutates mutable_acc in place (matching the upstream mutable-state contract) and returns None. Each call accumulates a weighted sum, not a weighted average -- the companion completeWeightedAvg (upstream LineupUtils.ts:752, not yet ported) divides by the accumulated weight totals to finish the average. The per-field weight used at each merge step is derived from obj's own totals (e.g. that single lineup's total_off_fga), not from any running total on mutable_acc -- callers accumulating many lineups must call weighted_avg once per lineup so every lineup contributes its own weight.

Parameters

ParameterTypeDefaultDescription
mutable_accLineupStatSetThe running accumulator (LineupStatSet). Mutated in place; fields absent from the accumulator are initialized to {"value": 0.0} (plus old_value / override when obj's field carries a luck-adjustment override marker) before obj's contribution is added.
objLineupStatSetThe per-lineup LineupStatSet document to merge in.

Returns

None. mutable_acc is mutated in place.

Raises

ExceptionDescription
NotImplementedErrorIf obj carries a game_info key -- that merge branch is deliberately deferred (see module docstring).

Example

from sportsdataverse.mbb.mbb_lineup_stats import weighted_avg

acc: dict = {}
weighted_avg(acc, lineup_a)
weighted_avg(acc, lineup_b)
print(acc["off_poss"]["value"]) # plain sum (SUM_FIELDS)

# Two-lineup possession-weighted merge

acc = {}
for lineup in three_lineups:
weighted_avg(acc, lineup)
# acc now holds weighted SUMS; complete_weighted_avg (not yet
# ported) is required to turn these into rate-stat averages.