Skip to main content
Version: 0.1.5

CFB — additional Python functions — Highlights

CFBPlayProcess​

CFBPlayProcess(gameId=0, raw=False, path_to_json='/', return_keys=None, odds_override=None, game_roster=None, participants=None, join_participants=True, **kwargs)

Process ESPN college-football play-by-play feeds into a tidy game-level dictionary.

Wraps the ESPN playbyplay / summary endpoints (or a local JSON dump) and pipes the result through a chain of feature-engineering steps -- down/distance, play-type flags, EPA, WPA, QBR, drive aggregation, and an advanced box score. Use run_processing_pipeline() for the full feature set or run_cleaning_pipeline() for a lighter clean.

Parameters

ParameterTypeDefaultDescription
gameId0ESPN game id.
rawFalseif True, espn_cfb_pbp() returns the (allowlisted) summary verbatim.
path_to_json'/'directory for cfb_pbp_disk() offline loads.
return_keysNoneoptional subset of result keys to return.
odds_overrideNoneoptional dict {gameSpread, overUnder, homeFavorite, gameSpreadAvailable} that short-circuits odds resolution (sets odds_source="injected") so offline rebuilds never hit the live core-odds endpoint or fall back to defaults. Validated + coerced here.
game_rosterNoneoptional pre-fetched game roster (the list of athlete records from ~sportsdataverse.cfb.cfb_game_rosters.espn_cfb_game_rosters, or the {"data": [...]} wrapper). Used by attach_player_idsto resolve a roster-backed{type}_player_idfor each extracted{type}_player_nameon games that lack a structuredparticipants[]` array (pre-2014). Passing it makes offline rebuilds fetch-free; when omitted the live path fetches the roster on demand only if needed.
participantsNone
join_participantsTruewhen True (default) the pipeline coalesces ESPN per-play participant names over the regex-extracted names and resolves a roster-backed {type}_player_id -- both of which hit the network (the participants/playbyplay endpoints and the game roster). Set False (CFBPlayProcess(..., join_participants=False)) to skip those lookups for a ~20x faster, network-free run. EPA / WPA / CPOE are unaffected (the models key on game state, not player identity); the cost is that {type}_player_id columns go null and names fall back to regex-from-text instead of clean ESPN displays.

Example

from sportsdataverse.cfb import CFBPlayProcess
proc = CFBPlayProcess(gameId=401628334)
proc.espn_cfb_pbp()
result = proc.run_processing_pipeline()
len(result["plays"])

# Offline replay from a JSON dump

proc = CFBPlayProcess(gameId=401628334, path_to_json="./pbp_dump")
proc.cfb_pbp_disk()
result = proc.run_processing_pipeline()

Methods

CFBPlayProcess.add_2pt_probs​

CFBPlayProcess.add_2pt_probs()

Add the cfb4th two-point-conversion decision surface to the processed plays.

Runs run_processing_pipeline first if it hasn't already, then computes the extra-point vs go-for-2 win-probability options on every point-after / two-point conversion row via sportsdataverse.cfb.cfb_two_point.get_2pt_probs. A row is treated as a PAT / two-point attempt when pointAfterAttempt.text is present (or the derived extra_point_result / two_point_conv_result is non-null). The new columns -- two_pt_wp, xp_wp, prob_2pt, two_pt_recommendation ("go_for_2" / "kick_xp") and two_pt_wp_diff (two_pt_wp - xp_wp, positive => go for 2) -- are written back onto self.plays_json (and self.json's plays); every other row carries nulls.

Returns

self.plays_json as a frame with the decision columns appended (also persisted back onto the instance).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
game.run_processing_pipeline()
out = game.add_2pt_probs()
print(out.filter(pl.col("two_pt_recommendation").is_not_null())
.select(["two_pt_wp", "xp_wp", "two_pt_recommendation"])
.head())

CFBPlayProcess.add_fourth_down_probs​

CFBPlayProcess.add_fourth_down_probs()

Add the cfb4th 4th-down decision surface to the processed plays.

Runs run_processing_pipeline first if it hasn't already, then computes the go / punt / field-goal win-probability options plus the max-WP fourth_down_recommendation (and per-option *_wp_diff and go_boost) on every 4th-down row via sportsdataverse.cfb.cfb_fourth_down.get_4th_down_probs. The new columns are written back onto self.plays_json (and self.json's plays); non-4th-down rows carry nulls for the decision columns.

Field-goal columns (fg_make_prob / make_fg_wp / miss_fg_wp / fg_wp) are null when the cfb4th FG model isn't bundled (cfb_fourth_down.FG_MODEL_AVAILABLE is False) -- the go + punt surface and the recommendation over the available options are still computed.

Returns

self.plays_json as a frame with the decision columns appended (also persisted back onto the instance).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
game.run_processing_pipeline()
fourth = game.add_fourth_down_probs()
print(fourth.filter(pl.col("start.down") == 4)
.select(["go_wp", "punt_wp", "fg_wp", "fourth_down_recommendation"])
.head())

CFBPlayProcess.cfb_pbp_disk​

CFBPlayProcess.cfb_pbp_disk()

Load a previously cached ESPN summary JSON for this game from disk.

Reads {path_to_json}/{gameId}.json where path_to_json was passed to the CFBPlayProcess constructor.

Returns

Parsed JSON contents, also stored on self.json.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334, path_to_json="./cache")
pbp = game.cfb_pbp_disk()
print(list(pbp.keys()))

CFBPlayProcess.cfb_pbp_json​

CFBPlayProcess.cfb_pbp_json(**kwargs)

Return the JSON payload currently attached to this CFBPlayProcess

instance.

Returns

The cached JSON payload (self.json).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
cached = game.cfb_pbp_json()

CFBPlayProcess.corrupt_pbp_check​

CFBPlayProcess.corrupt_pbp_check()

Heuristic check for corrupt or incomplete play-by-play.

Flags games with zero plays, fewer than 50 plays for a completed game, or more than 500 plays for a completed game -- all of which historically indicate ESPN delivered a malformed PBP payload that should not be processed downstream.

Returns

True if PBP looks corrupt and the processing pipeline should be skipped, False otherwise.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
if not game.corrupt_pbp_check():
game.run_processing_pipeline()

CFBPlayProcess.create_box_score​

CFBPlayProcess.create_box_score(play_df)

Build a per-team and per-player advanced box score from a processed

plays frame.

Triggers run_processing_pipeline first if it hasn't already run, so the input play_df is expected to be the post-pipeline plays frame.

Parameters

ParameterTypeDefaultDescription
play_dfpl.DataFrameThe plays frame produced by run_processing_pipeline (with EPA, WPA and play-type flags already populated).

Returns

Box-score sections, each a list of records — "pass" / "rush" / "receiver" (per-player advanced + EPA lines; the pass and receiver lines carry AirYds / aDOT / CompAirYds / YAC / AirYdsPct, null when ESPN's text has no catch spot), "team" and "situational" (per-team), "defensive" and "defensive_players" (team- and player-level havoc), "specialists" (kicking / punting / return players), "turnover", "drives", and the ESPN-sourced "espn_team" / "espn_players" totals.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
processed = game.run_processing_pipeline()
box = game.create_box_score(game.plays_json)
print(list(box.keys()))

CFBPlayProcess.create_drive_summary​

CFBPlayProcess.create_drive_summary(play_df, drives, periods=None) -> 'dict | None'

Build the StatBroadcast-style drive summary for this game.

Thin delegate to sportsdataverse.cfb.cfb_drive_summary.create_drive_summary, with the team ids read from the plays frame -- the drive-level sibling of create_box_score.

Parameters

ParameterTypeDefaultDescription
play_dfpl.DataFramethe post-pipeline plays frame (plays_frame).
driveslist[dict]the ESPN drives grouping in game order.
periodsNoneoptional window (a set of quarter numbers, or "ot").

Returns

the drive summary, or None when inputs are unusable.

CFBPlayProcess.create_situational_stats​

CFBPlayProcess.create_situational_stats(play_df, window_expr=None) -> 'dict | None'

Build the situational team-stats block for this game.

Thin delegate to sportsdataverse.cfb.cfb_situational_stats.create_situational_stats, with the team ids read from the plays frame.

Parameters

ParameterTypeDefaultDescription
play_dfpl.DataFramethe post-pipeline plays frame (plays_frame).
window_exprNoneoptional polars filter windowing the windowable sections (e.g. pl.col("period") == 3).

Returns

the situational stats, or None when the frame is unusable or the window is empty.

CFBPlayProcess.espn_cfb_pbp​

CFBPlayProcess.espn_cfb_pbp(summary=None, **kwargs)

espn_cfb_pbp() - Pull the game by id. Data from API endpoints: college-football/playbyplay,

college-football/summary

Parameters

ParameterTypeDefaultDescription
summarydict, optionalNoneA previously fetched ESPN summary payload. When given, no request is made -- the offline path for committed raw libraries -- and the pipeline joins participants only if participants= was passed at construction (it never fetches them, nor a roster, for a supplied summary).

Returns

Dictionary of game data with keys - "gameId", "plays", "boxscore", "header", "broadcasts", "videos", "playByPlaySource", "standings", "leaders", "timeouts", "homeTeamSpread", "overUnder", "pickcenter", "againstTheSpread", "odds", "predictor", "winprobability", "espnWP", "gameInfo", "season"

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
pbp = game.espn_cfb_pbp()
print(list(pbp.keys()))

# Pull only the raw ESPN summary payload (skip cleaning)

raw_pbp = CFBPlayProcess(gameId=401628334, raw=True).espn_cfb_pbp()

# Pipeline next step (run the full processing pipeline for advanced features)

game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
processed = game.run_processing_pipeline() # adds EPA, WPA, box score

CFBPlayProcess.run_cleaning_pipeline​

CFBPlayProcess.run_cleaning_pipeline()

Run the lighter cleaning pipeline (no EPA/WPA/QBR/box-score).

Same per-play feature engineering as run_processing_pipeline through add_spread_time`, but stops short of the modeling steps. Use this when you only need cleaned plays and don't need expected points or win probability columns.

Returns

Cleaned game payload (no advBoxScore key).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
cleaned = game.run_cleaning_pipeline()
print(len(cleaned["plays"]))

CFBPlayProcess.run_processing_pipeline​

CFBPlayProcess.run_processing_pipeline(fourth_down_probs: 'bool' = True, two_pt_probs: 'bool' = True, validate: 'bool' = False)

Run the full play-by-play processing pipeline.

Applies every scoring/feature step in order: down detection, play type flags, rush/pass flags, team score variables, new play types, penalty setup, play category flags, yardage cols, player cols, after cols, spread time, EPA, WPA, drive data, and QBR. Also produces an advanced box score and stores it under advBoxScore on the returned dict.

Idempotent -- subsequent calls return the cached self.json.

Parameters

ParameterTypeDefaultDescription
fourth_down_probsboolTruewhen True (default), run the cfb4th decision surface (sportsdataverse.cfb.cfb_fourth_down.get_4th_down_probs) on the enriched frame and append the go/field-goal/punt WP columns plus the fourth_down_recommendation to 4th-down plays (null elsewhere). Pass False to skip it (e.g. to avoid loading the fourth-down model).
two_pt_probsboolTruewhen True (default), run the cfb4th two-point decision surface (sportsdataverse.cfb.cfb_two_point.get_2pt_probs) and append two_pt_wp / xp_wp / prob_2pt / two_pt_recommendation / two_pt_wp_diff to point-after / two-point rows (null elsewhere).
validateboolFalsewhen True, score the processed frame with the packaged per-game gate (sportsdataverse.validation) and attach its report dict under the "validation" key of the processed game ({} when the pipeline produced no plays). Name "validation" in return_keys to get it back when a subset was requested. Off by default -- the gate costs a few milliseconds and most callers do not read it.

Returns

The fully-processed game payload. If the constructor was given return_keys, only those keys are returned.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
processed = game.run_processing_pipeline()
print(processed["advBoxScore"].keys())

# Pipeline next step (return only selected keys)

game = CFBPlayProcess(gameId=401628334, return_keys=["plays", "advBoxScore"])
game.espn_cfb_pbp()
trimmed = game.run_processing_pipeline()

cfb_advanced_stats​

cfb_advanced_stats(seasons: 'Union[int, list[int]]', *, adjust: 'bool' = True, exclude_garbage: 'bool' = True, as_of_date: 'Optional[datetime.date]' = None, config: 'Optional[AdjustConfig]' = None, return_as_pandas: 'bool' = False) -> 'Union[pl.DataFrame, pd.DataFrame]'

Team-season CFB advanced stats: efficiency, explosiveness, havoc.

Loads play-by-play via load_cfb_pbp, builds the garbage-filtered per-play long frame, aggregates raw per-team offense/defense success rate, EPA/play, isoPPP (mean EPA on successful plays), explosive rate and havoc, and (default) opponent-adjusts each metric with the iterative solver.

Parameters

ParameterTypeDefaultDescription
seasonsUnion[int, list[int]]season or list of seasons (hosted pbp covers 2002-2021).
adjustboolTrueadd adj_* opponent-adjusted columns + EPA ranks.
exclude_garbageboolTruedrop Connelly garbage-time plays.
as_of_dateOptional[date]Noneleakage boundary -- only plays strictly before this date contribute.
configOptional[AdjustConfig]NoneAdjustConfig for the solver.
return_as_pandasboolFalsereturn a pandas DataFrame instead of polars.

Returns

One row per (season, team_id) with the raw columns (and adj_* plus off_epa_rank/def_epa_rank when adjust=True). Empty input returns a zero-row frame with the documented schema.

col_nametypedescription
seasonintegerSeason the stats cover.
team_idcharacterTeam ESPN id (character join key).
playsintegerSituation-neutral offensive plays in the aggregate.
off_success_ratedoubleOffensive success rate (yards gained >= 50/70/100 percent of distance by down).
def_success_ratedoubleSuccess rate allowed (Connelly 50/70/100 yardage rule).
off_epa_playdoubleRaw offensive EPA per play on the garbage-filtered substrate (garbage time excluded by default; pass exclude_garbage=False to keep it).
def_epa_playdoubleRaw EPA allowed per play on the garbage-filtered substrate (garbage time excluded by default; pass exclude_garbage=False to keep it).
off_iso_pppdoubleMean EPA on successful offensive plays (Connelly isoPPP explosiveness).
def_iso_pppdoubleMean EPA allowed on successful plays faced (isoPPP against).
off_explosive_ratedoubleShare of offensive plays that were explosive (pass EPA >= 2.4, rush EPA >= 1.8).
def_explosive_ratedoubleShare of plays faced that were explosive (pass EPA >= 2.4, rush EPA >= 1.8).
def_havocdoubleShare of plays faced with a havoc event (TFL, pass breakup, interception, forced fumble).
off_havoc_alloweddoubleShare of offensive plays on which the defense recorded a havoc event.
off_epa_success_ratedoubleShare of offensive plays with EPA > 0 (EPA-based success rate).
adj_off_epa_playdoubleOpponent-adjusted offensive EPA per play (higher is better).
adj_off_success_ratedoubleOpponent-adjusted offensive success rate.
adj_off_explosive_ratedoubleOpponent-adjusted offensive explosive-play rate.
adj_def_epa_playdoubleOpponent-adjusted EPA allowed per play (lower is better).
adj_def_success_ratedoubleOpponent-adjusted success rate allowed.
adj_def_explosive_ratedoubleOpponent-adjusted explosive-play rate allowed.
adj_def_havocdoubleOpponent-adjusted havoc rate created by the defense.
adj_off_havoc_alloweddoubleOpponent-adjusted havoc rate the offense allows.
off_epa_rankintegerDense rank on adj_off_epa_play descending (best offense = 1).
def_epa_rankintegerDense rank on adj_def_epa_play ascending (fewest EPA allowed = 1).

Example

from sportsdataverse.cfb import cfb_advanced_stats
df = cfb_advanced_stats([2021])
print(df.shape)

# Raw only, garbage time kept

df_raw = cfb_advanced_stats(2021, adjust=False, exclude_garbage=False)

# Pipeline next step (one line)

df.sort("adj_off_epa_play", descending=True).head()

cfb_standings​

cfb_standings(games: 'FrameLike', teams: 'FrameLike', *, tiebreaker_depth: 'str' = 'SOS', playoff_seeds: 'Optional[int]' = None, rankings: 'Optional[FrameLike]' = None, tiebreaker_data: 'Optional[Dict[str, FrameLike]]' = None, return_as_pandas: 'bool' = False, rng: 'Optional[np.random.Generator]' = None) -> 'Union[pl.DataFrame, Any]'

Compute college football standings with conference ranks and champions.

Engine design adapted from nflseedR (MIT, Sebastian Carl & Lee Sharpe); see the module docstring for the documented CFB simplifications, and its "Official per-conference tiebreakers (registry)" section for how CONFERENCE_TIEBREAKERS overrides the generic cascade for the SEC, Big Ten, Big 12, ACC and MAC.

Parameters

ParameterTypeDefaultDescription
gamesFrameLikeGame results with columns sim (or season), week, game_type (REG | CONF_CHAMP | POST), home_team, away_team, result (home margin: home - away; null = unplayed), optional neutral (0/1), and optional home_points/away_points (per-game scores — feeds the SEC capped-scoring-margin rung; cfb_games_from_schedule emits both). Either optional input absent -> that rung is skipped, not an error.
teamsFrameLikeTeam table with columns team and conference (null or "FBS Independents" marks an independent), and an optional division column ("FBS"/"FCS" or similar — feeds the Big 12 total_wins FCS cap; absent -> the cap degrades to uncapped win totals, noted in tiebreak_notes).
tiebreaker_depthstr'SOS'One of "RANDOM", "PRE-SOV", "SOS", "POINTS" — the nflseedR depth ladder. Steps beyond the chosen depth are skipped and remaining ties are broken by coin flip. Gates ONLY the generic fallback cascade; registered official conference procedures (below) always run in full.
playoff_seedsOptional[int]NoneIf set, adds a seed column via cfb_playoff_seeds with this field size.
rankingsOptional[FrameLike]NoneOptional committee-style rankings frame (team, rank) forwarded to cfb_playoff_seeds.
tiebreaker_dataOptional[Dict[str, FrameLike]]NoneOptional external inputs for the registry rungs, as a dict with key "analytics_ratings" -> a frame with columns team and rating (feeds the analytics_rating rung used by Big Ten/Big 12/ACC/MAC). A "cfp_rankings" key (team, rank) is accepted for forward compatibility but unused by the current registry (no registered conference has a cfp_ranking rung yet). Missing -> the rung is skipped, noted.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.
rngOptional[Generator]NoneOptional numpy Generator used only for coin-flip tiebreaks (simulations pass their seeded generator through here).

Returns

A polars (or pandas) DataFrame with one row per (sim, team): overall record (games/wins/losses/ties/win_pct/ pd), conference record (conf_*), sov, sos, conf_rank (null for independents), conf_champ and, when playoff_seeds is set, seed. The result also carries a tiebreak_notes list of skipped-rung messages (see the module docstring): result.tiebreak_notes for a polars frame, result.attrs["tiebreak_notes"] for a pandas frame (pandas' own metadata mechanism — avoids its "new attribute" warning).

col_nametypedescription
simintegerSeason or simulation identifier the standings row belongs to.
teamcharacterTeam name (join key across the seedr engine frames).
conferencecharacterConference the team belongs to; null or "FBS Independents" marks an independent.
gamesintegerTotal games played across all game types (regular season, conference championship and postseason).
winsintegerWins across all played games (conference championship and postseason included).
lossesintegerLosses across all played games.
tiesintegerTies across all played games.
win_pctdoubleOverall win percentage - (wins + 0.5 * ties) / games, 0.0 when no games have been played.
pddoublePoint differential (points for minus points against, via game margins) summed over all played games.
conf_gamesintegerNumber of conference regular-season games played (both teams in the same conference; CONF_CHAMP games excluded).
conf_winsintegerWins in conference regular-season games.
conf_lossesintegerLosses in conference regular-season games.
conf_tiesintegerTies in conference regular-season games.
conf_pctdoubleConference win percentage - (conf_wins + 0.5 * conf_ties) / conf_games, 0.0 with no conference games; the primary sort key for conference ranks.
conf_pddoublePoint differential summed over conference regular-season games only; the POINTS-depth tiebreaker rung.
sovdoubleStrength of victory, conference-REG-scoped (unlike nflseedR's overall games-weighted version) - mean of defeated conference opponents' conference win pct, one term per conference victory; 0.0 for independents or teams without conference wins.
sosdoubleStrength of schedule, conference-REG-scoped (unlike nflseedR's overall games-weighted version) - mean of conference opponents' conference win pct across all conference games played; 0.0 for independents.
conf_rankintegerRank within the conference from the tiebreaker cascade (1 = best); null for independents.
conf_champlogicalWhether the team is its conference's champion - the CONF_CHAMP game winner when one was played, otherwise the conference's rank-1 team; always false for independents.

Example

import polars as pl
from sportsdataverse.cfb import cfb_standings

games = pl.DataFrame({
"sim": [2024, 2024], "week": [1, 2],
"game_type": ["REG", "REG"],
"home_team": ["A", "B"], "away_team": ["B", "A"],
"result": [7.0, -3.0], "neutral": [0, 0],
})
teams = pl.DataFrame({"team": ["A", "B"], "conference": ["X", "X"]})
print(cfb_standings(games, teams))

# With CFP seeds from committee rankings

st = cfb_standings(games, teams, playoff_seeds=12, rankings=ranks_df)

# With an official-registry analytics rating input

ratings = pl.DataFrame({"team": ["A", "B"], "rating": [92.1, 88.4]})
st = cfb_standings(games, teams, tiebreaker_data={"analytics_ratings": ratings})
print(st.tiebreak_notes)

espn_cfb_player_stats​

espn_cfb_player_stats(athlete_id: 'int', season: 'int', *, season_type: 'str' = 'regular', total: 'bool' = False, raw: 'bool' = False, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame | dict[str, Any]'

Pull a college-football athlete's ESPN season stat line.

See sportsdataverse.wbb.espn_wbb_player_stats for full documentation of the wide return shape, the {category}_{stat} stat columns (for football: passing_*, rushing_*, receiving_*, scoring_*, ...), the athlete / team metadata blocks, and the season_type / total parameters. For the richer multi-category web-v3 payload use sportsdataverse.cfb.espn_cfb_player_stats_v3.

Parameters

ParameterTypeDefaultDescription
athlete_idintESPN college-football athlete identifier.
seasonintSeason year, used in the core-v2 path.
season_typestr'regular'"regular" (type 2) or "postseason" (type 3).
totalboolFalseForward-compat totals passthrough.
rawboolFalseIf True, returns the raw core-v2 statistics JSON dict.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; else polars.

Returns

A single-row wide DataFrame (polars by default). When raw=True returns the raw statistics JSON dict.

col_nametypedescription
seasonintegerSeason (4-digit year).
season_typecharacterESPN season type (2 = regular, 3 = postseason).
totallogical
athlete_idintegerESPN athlete id.
athlete_uidcharacter
athlete_guidcharacter
athlete_typecharacter
first_namecharacterAthlete first name.
last_namecharacterAthlete last name.
full_namecharacterVenue full name (e.g. Tenney Stadium).
display_namecharacterHuman-readable metric name.
short_namecharacterRanking source short name (e.g. AP Poll).
weightdoubleListed weight (lbs).
display_weightcharacterHuman-readable weight (e.g. 205 lbs).
heightdoubleListed height (inches).
display_heightcharacterHuman-readable height (e.g. 6' 1").
ageinteger
date_of_birthcharacterPlayer date of birth (if published).
jerseycharacterJersey number.
slugcharacterURL slug for the team.
activelogicalTRUE if the player was active for the game.
position_idintegerESPN position id.
position_namecharacterPosition name (e.g. Quarterback).
position_display_namecharacterHuman-readable position name.
position_abbreviationcharacterPosition abbreviation (e.g. QB).
college_namecharacter
status_idintegerESPN commitment status id.
status_namecharacterStatus-type key (e.g. STATUS_FINAL).
general_fumblesdoubleTotal number of fumbles committed by the player across all offensive and special-teams plays.
general_fumbles_lostdoubleNumber of fumbles the player committed that were recovered by the opposing team.
general_fumbles_touchdownsdoubleTotal touchdowns scored by the player as a result of fumble recoveries, combining offensive and defensive occurrences.
general_games_playeddouble
general_offensive_two_pt_returnsdoubleNumber of two-point conversions the player scored by returning a blocked or intercepted two-point attempt on the offensive side.
general_offensive_fumbles_touchdownsdoubleNumber of touchdowns scored by the player on fumble recoveries credited to the offensive category.
general_defensive_fumbles_touchdownsdoubleNumber of touchdowns scored by the player on fumble recoveries attributed to the defensive category.
passing_avg_gaindoubleAverage yards gained per passing play attempt by the quarterback in the passing category.
passing_completion_pctdoublePercentage of pass attempts thrown by the quarterback that were completed, calculated as completions divided by attempts.
passing_completionsdoublePass completions (split from CFBD's C/ATT field).
passing_espnqb_ratingdoubleESPN's proprietary quarterback rating for the player's passing performance, factoring in efficiency metrics beyond traditional passer rating.
passing_interception_pctdoublePercentage of pass attempts that resulted in an interception, calculated as interceptions divided by passing attempts.
passing_interceptionsdoubleTotal number of passes thrown by the quarterback that were intercepted by the defense.
passing_long_passingdoubleLongest single completed pass in yards recorded by the quarterback during the stat period.
passing_net_passing_yardsdoubleNet passing yards gained by the quarterback after subtracting yardage lost on sacks from gross passing yards.
passing_net_passing_yards_per_gamedoubleNet passing yards per game for the quarterback, computed as net passing yards divided by games played.
passing_net_total_yardsdoubleCombined net yardage from passing and rushing for a quarterback, accounting for sack yardage lost in the passing category.
passing_net_yards_per_gamedoubleNet total yards gained per game for the player as recorded in the passing category context.
passing_passing_attemptsdoubleTotal number of pass attempts thrown by the quarterback, including completions, incompletions, and interceptions.
passing_passing_big_playsdoubleNumber of passing plays that gained 20 or more yards as recorded for the quarterback.
passing_passing_first_downsdoubleNumber of first downs gained by the team on passing plays thrown by the quarterback.
passing_passing_fumblesdoubleNumber of fumbles the quarterback committed during passing plays, including fumbled snaps and sack fumbles.
passing_passing_fumbles_lostdoubleNumber of fumbles the quarterback committed on passing plays that were recovered by the opposing team.
passing_passing_touchdown_pctdoublePercentage of pass attempts that resulted in a passing touchdown, calculated as touchdowns divided by attempts.
passing_passing_touchdownsdoubleTotal number of touchdown passes thrown by the quarterback.
passing_passing_yardsdoubleGross passing yards gained by the quarterback on completed passes.
passing_passing_yards_after_catchdoubleTotal yards gained by receivers after the catch on passes thrown by the quarterback.
passing_passing_yards_at_catchdoubleTotal yards gained at the point of the catch (air yards) on passes thrown by the quarterback, before any yards after catch.
passing_passing_yards_per_gamedoubleGross passing yards per game for the quarterback, computed as passing yards divided by games played.
passing_qb_ratingdoubleTraditional NCAA passer rating for the quarterback, calculated from completion percentage, yards per attempt, touchdown rate, and interception rate.
passing_sacksdoubleTotal number of times the quarterback was sacked (tackled behind the line of scrimmage on a passing play).
passing_sack_yards_lostdoubleTotal yards lost by the quarterback as a result of being sacked, subtracted when computing net passing yards.
passing_team_games_playeddoubleNumber of team games played during the stat period, used as the denominator for per-game passing rate statistics.
passing_total_offensive_playsdoubleTotal number of offensive plays (pass attempts plus rushes) for the team during the stat period, recorded in the passing category context.
passing_total_points_per_gamedoubleAverage total points scored per game by the player's team as recorded alongside passing statistics.
passing_total_touchdownsdoubleTotal touchdowns accounted for by the quarterback across passing and rushing in the passing category context.
passing_total_yardsdoubleTotal offensive yardage (passing plus rushing) accumulated by the quarterback as reported in the passing category.
passing_total_yards_from_scrimmagedoubleTotal yards from scrimmage accumulated by the quarterback (passing plus rushing yards) in the passing category context.
passing_two_point_pass_convsdoubleNumber of successful two-point conversions the quarterback converted via a passing play.
passing_two_pt_passdoubleIndicator or count of two-point conversion passing attempts recorded for the quarterback.
passing_two_pt_pass_attemptsdoubleTotal number of two-point conversion attempts the quarterback made via a passing play.
passing_yards_from_scrimmage_per_gamedoubleAverage yards from scrimmage per game for the quarterback as reported in the passing category.
passing_yards_per_completiondoubleAverage yards gained per completed pass by the quarterback, calculated as passing yards divided by completions.
passing_yards_per_gamedoubleAverage gross passing yards per game for the quarterback, equivalent to passing_passing_yards_per_game.
passing_yards_per_pass_attemptdoubleAverage yards gained per pass attempt by the quarterback, calculated as passing yards divided by attempts.
passing_net_yards_per_pass_attemptdoubleNet passing yards divided by total pass attempts, including sack yardage lost in the denominator's context.
passing_qbrdoubleESPN Quarterback Rating (QBR) for the player in this game.
passing_adj_qbrdoubleESPN's adjusted Total Quarterback Rating (QBR) for the player's passing performance, controlling for opponent difficulty and game situation.
passing_quarterback_ratingdoubleTraditional passer rating for the quarterback, equivalent to passing_qb_rating, using the standard NCAA formula.
passing_offensive_snap_pctdoubleESPN's offensiveSnapPct stat (described upstream as '% of plays the player was on the field'); 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
passing_target_share_pctdoubleESPN's targetSharePct stat (described upstream as '% of total team targets'); 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
passing_yards_per_route_rundoubleESPN's yardsPerRouteRun stat (yards per route run, YPRR) under the passing category; 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
passing_avg_depth_of_targetdoubleESPN's avgDepthOfTarget stat (average depth of target, aDOT) under the passing category; 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
rushing_avg_gaindoubleAverage yards gained per rushing attempt for the player in the rushing category.
rushing_espnrb_ratingdoubleESPN's proprietary running back rating for the player's rushing performance.
rushing_long_rushingdoubleLongest single rushing carry in yards recorded by the player during the stat period.
rushing_net_total_yardsdoubleNet total yardage accumulated by the player from rushing and any receiving contributions as reported in the rushing category.
rushing_net_yards_per_gamedoubleNet total yards per game for the player as reported in the rushing category context.
rushing_rushing_attemptsdoubleTotal number of rushing attempts (carries) credited to the player.
rushing_rushing_big_playsdoubleNumber of rushing plays that gained 10 or more yards for the player.
rushing_rushing_first_downsdoubleNumber of first downs gained by the player via rushing plays.
rushing_rushing_fumblesdoubleNumber of fumbles the player committed on rushing plays.
rushing_rushing_fumbles_lostdoubleNumber of fumbles the player committed on rushing plays that were recovered by the opposing team.
rushing_rushing_touchdownsdoubleTotal number of rushing touchdowns scored by the player.
rushing_rushing_yardsdoubleTotal yards gained by the player on rushing attempts.
rushing_rushing_yards_per_gamedoubleAverage rushing yards per game for the player, calculated as rushing yards divided by games played.
rushing_stuffsdoubleNumber of rushing attempts in which the player was stopped at or behind the line of scrimmage.
rushing_stuff_yards_lostdoubleTotal yards lost by the player on stuffed rushing plays (carries stopped at or behind the line of scrimmage).
rushing_team_games_playeddoubleNumber of team games played during the stat period, used as the denominator for per-game rushing rate statistics.
rushing_total_offensive_playsdoubleTotal number of offensive plays for the team during the stat period, recorded in the rushing category context.
rushing_total_points_per_gamedoubleAverage total points scored per game by the player's team as recorded alongside rushing statistics.
rushing_total_touchdownsdoubleTotal touchdowns scored by the player across all methods as reported in the rushing category context.
rushing_total_yardsdoubleTotal offensive yardage accumulated by the player as reported in the rushing category.
rushing_total_yards_from_scrimmagedoubleTotal yards from scrimmage for the player (rushing plus receiving yards) as reported in the rushing category.
rushing_two_point_rush_convsdoubleNumber of successful two-point conversions the player converted via a rushing play.
rushing_two_pt_rushdoubleIndicator or count of two-point conversion rushing attempts recorded for the player.
rushing_two_pt_rush_attemptsdoubleTotal number of two-point conversion attempts the player made via a rushing play.
rushing_yards_from_scrimmage_per_gamedoubleAverage yards from scrimmage per game for the player as reported in the rushing category.
rushing_yards_per_gamedoubleAverage rushing yards per game for the player, equivalent to rushing_rushing_yards_per_game.
rushing_yards_per_rush_attemptdoubleAverage yards gained per rushing attempt for the player, calculated as rushing yards divided by attempts.
receiving_avg_gaindoubleAverage yards gained per reception for the player in the receiving category.
receiving_espnwr_ratingdoubleESPN's proprietary wide receiver / pass-catcher rating for the player's receiving performance.
receiving_long_receptiondoubleLongest single reception in yards recorded by the player during the stat period.
receiving_net_total_yardsdoubleNet total yardage accumulated by the player from receiving and any rushing contributions as reported in the receiving category.
receiving_net_yards_per_gamedoubleNet total yards per game for the player as reported in the receiving category context.
receiving_receiving_big_playsdoubleNumber of receiving plays that gained 20 or more yards for the player.
receiving_receiving_first_downsdoubleNumber of first downs gained by the player via receptions.
receiving_receiving_fumblesdoubleNumber of fumbles the player committed after catching a pass.
receiving_receiving_fumbles_lostdoubleNumber of fumbles the player committed on receiving plays that were recovered by the opposing team.
receiving_receiving_targetsdoubleTotal number of times the player was targeted as the intended receiver on a pass play.
receiving_receiving_touchdownsdoubleTotal number of touchdown receptions scored by the player.
receiving_receiving_yardsdoubleTotal yards gained by the player on completed receptions.
receiving_receiving_yards_after_catchdoubleTotal yards gained by the player after the catch on receiving plays.
receiving_receiving_yards_at_catchdoubleTotal air yards gained at the point of the catch on receiving plays, before any yards after catch.
receiving_receiving_yards_per_gamedoubleAverage receiving yards per game for the player, calculated as receiving yards divided by games played.
receiving_receptionsdoubleTotal number of completed receptions (catches) recorded by the player.
receiving_team_games_playeddoubleNumber of team games played during the stat period, used as the denominator for per-game receiving rate statistics.
receiving_total_offensive_playsdoubleTotal number of offensive plays for the team during the stat period, recorded in the receiving category context.
receiving_total_points_per_gamedoubleAverage total points scored per game by the player's team as recorded alongside receiving statistics.
receiving_total_touchdownsdoubleTotal touchdowns scored by the player across all methods as reported in the receiving category context.
receiving_total_yardsdoubleTotal offensive yardage accumulated by the player as reported in the receiving category.
receiving_total_yards_from_scrimmagedoubleTotal yards from scrimmage for the player (receiving plus rushing yards) as reported in the receiving category.
receiving_two_point_rec_convsdoubleNumber of successful two-point conversions the player converted via a reception.
receiving_two_pt_receptiondoubleIndicator or count of two-point conversion receptions recorded for the player.
receiving_two_pt_reception_attemptsdoubleTotal number of two-point conversion attempts the player made via a receiving play.
receiving_yards_from_scrimmage_per_gamedoubleAverage yards from scrimmage per game for the player as reported in the receiving category.
receiving_yards_per_gamedoubleAverage receiving yards per game for the player, equivalent to receiving_receiving_yards_per_game.
receiving_yards_per_receptiondoubleAverage yards gained per reception for the player, calculated as receiving yards divided by receptions.
scoring_defensive_pointsdoubleTotal points scored by the player through defensive plays such as defensive touchdowns, safeties, or fumble-return scores.
scoring_field_goalsdoubleTotal number of field goals made by the player in the scoring category.
scoring_kick_extra_pointsdoubleTotal number of extra point attempts kicked by the player.
scoring_kick_extra_points_madedoubleTotal number of successful extra points (PATs) kicked by the player.
scoring_misc_pointsdoublePoints scored by the player through miscellaneous means not captured by standard scoring categories.
scoring_passing_touchdownsdoubleTotal touchdown passes thrown by the player as counted in the scoring category.
scoring_receiving_touchdownsdoubleTotal touchdown receptions scored by the player as counted in the scoring category.
scoring_return_touchdownsdoubleTotal touchdowns scored by the player on kick or punt returns as counted in the scoring category.
scoring_rushing_touchdownsdoubleTotal rushing touchdowns scored by the player as counted in the scoring category.
scoring_total_pointsdoubleTotal points scored by the player across all scoring methods during the stat period.
scoring_total_points_per_gamedoubleAverage total points scored by the player per game during the stat period.
scoring_total_touchdownsdoubleTotal touchdowns scored by the player across all methods (passing, rushing, receiving, and return) in the scoring category.
scoring_total_two_point_convsdoubleTotal number of successful two-point conversions scored by the player across passing, rushing, and receiving attempts.
scoring_two_point_pass_convsdoubleNumber of successful two-point conversions the player scored via a passing play, as counted in the scoring category.
scoring_two_point_rec_convsdoubleNumber of successful two-point conversions the player scored via a reception, as counted in the scoring category.
scoring_two_point_rush_convsdoubleNumber of successful two-point conversions the player scored via a rushing play, as counted in the scoring category.
scoring_one_pt_safeties_madedoubleNumber of one-point safeties scored by the player's team, credited in the scoring category.
team_idintegerESPN team id.
team_uidcharacter
team_guidcharacter
team_slugcharacterTeam slug for the stat row.
team_locationcharacterTeam location / school name.
team_namecharacterTeam nickname.
team_abbreviationcharacterTeam abbreviation.
team_display_namecharacterFull team display name.
team_short_display_namecharacterShort team display name.
team_colorcharacterPrimary team color.
team_alternate_colorcharacterAlternate team color.
team_is_activelogical
team_logo_hrefcharacterDefault team logo URL.

Example

from sportsdataverse.cfb import espn_cfb_player_stats
df = espn_cfb_player_stats(athlete_id=4426338, season=2023)
df.select(["full_name", "team_display_name", "passing_passing_yards"])

espn_cfb_schedule​

espn_cfb_schedule(dates=None, week=None, season_type=None, groups=None, limit=500, return_as_pandas=False, **kwargs) -> 'pl.DataFrame'

espn_cfb_schedule - look up the college football schedule for a given season

Parameters

ParameterTypeDefaultDescription
datesintNoneUsed to define different seasons. 2002 is the earliest available season.
weekintNoneWeek of the schedule.
season_typeintNone2 for regular season, 3 for post-season, 4 for off-season.
groupsintNoneUsed to define different divisions. 80 is FBS, 81 is FCS.
limitint500number of records to return, default: 500.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing schedule dates for the requested season. Returns None if no games

col_nametypedescription
idcharacter247Sports referencing id for the recruit.
uidcharacterESPN global unique identifier.
datecharacterDate of the poll release.
attendanceintegerReported attendance at the game.
time_validlogical
date_validlogicalBoolean flag indicating whether the game's scheduled date is confirmed and valid.
neutral_sitelogicalTRUE/FALSE flag for if the game took place at a neutral site.
conference_competitionlogical
play_by_play_availablelogical
recentlogical
start_datecharacterSeason start timestamp (ISO 8601, UTC).
broadcastcharacterBroadcast network short name.
highlightsintegerGame highlight urls.
notes_typecharacter
notes_headlinecharacter
broadcast_marketcharacter
broadcast_namecharacter
type_idcharacterPlay-type id.
type_abbreviationcharacterPlay-type abbreviation (e.g. RUSH, TD).
venue_idcharacterReferencing venue id.
venue_full_namecharacter
venue_address_citycharacter
venue_address_statecharacter
venue_address_countrycharacterCountry in which the game venue is located, as provided by ESPN's venue data.
venue_indoorlogicalWhether the home venue is indoors.
status_clockdouble
status_display_clockcharacter
status_periodinteger
status_type_idcharacter
status_type_namecharacter
status_type_statecharacter
status_type_completedlogical
status_type_descriptioncharacter
status_type_detailcharacter
status_type_short_detailcharacter
groups_idcharacter
groups_namecharacter
groups_short_namecharacter
groups_is_conferencelogical
format_regulation_periodsinteger
home_idcharacterHome team referencing id.
home_uidcharacter
home_locationcharacter
home_namecharacter
home_abbreviationcharacter
home_display_namecharacter
home_short_display_namecharacter
home_colorcharacter
home_alternate_colorcharacter
home_is_activelogical
home_venue_idcharacter
home_logocharacter
home_conference_idcharacter
home_scorecharacterHome-team score after the play.
home_current_rankintegerAP or Coaches Poll ranking of the home team at the time of the game (null if unranked).
home_linescoreslistPer-period point totals for the home team, stored as an array of quarter/overtime scores.
home_recordscharacterWin-loss record of the home team at the time of the game, as reported by ESPN (e.g., overall or conference record).
away_idcharacterAway team referencing id.
away_uidcharacter
away_locationcharacter
away_namecharacter
away_abbreviationcharacter
away_display_namecharacter
away_short_display_namecharacter
away_colorcharacter
away_alternate_colorcharacter
away_is_activelogical
away_venue_idcharacter
away_logocharacter
away_conference_idcharacter
away_scorecharacterAway-team score after the play.
away_current_rankintegerAP or Coaches Poll ranking of the away team at the time of the game (null if unranked).
away_linescoreslistPer-period point totals for the away team, stored as an array of quarter/overtime scores.
away_recordscharacterWin-loss record of the away team at the time of the game, as reported by ESPN (e.g., overall or conference record).
game_idintegerESPN game identifier.
seasonintegerSeason (4-digit year).
season_typeintegerESPN season type (2 = regular, 3 = postseason).
weekintegerGame week of the season.
home_logo_darkcharacter
away_logo_darkcharacter
home_winnerlogical
away_winnerlogical

Example

from sportsdataverse.cfb import espn_cfb_schedule
slate = espn_cfb_schedule()
print(slate.shape if slate is not None else "no games")

# Pull a specific week of FBS games

week5 = espn_cfb_schedule(dates=2023, week=5, season_type=2)

# Pipeline next step (extract finals only)

import polars as pl
finals = espn_cfb_schedule(dates=2023, week=5).filter(
pl.col("status_type_completed") == True
)

get_cfb_teams​

get_cfb_teams(return_as_pandas=False) -> 'pl.DataFrame'

Load college football team ID information and logos

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing teams available.

col_nametypedescription
team_idintegerESPN team id.
schoolcharacterTeam name.
mascotcharacterTeam mascot.
abbreviationcharacterMetric abbreviation.
alt_name1characterTeam alternate name 1 (as it appears in play_text).
alt_name2characterTeam alternate name 2 (as it appears in play_text).
alt_name3characterTeam alternate name 3 (as it appears in play_text).
conferencecharacterConference of the team.
divisioncharacterDivision in the conference for the team.
colorcharacterPrimary team color (hex, no #).
alt_colorcharacterTeam color (alternate).
logocharacter
logo_darkcharacter

Example

from sportsdataverse.cfb import get_cfb_teams
teams = get_cfb_teams()
print(teams.shape)

# Pandas round-trip

teams_pd = get_cfb_teams(return_as_pandas=True)
teams_pd.head()

# Pipeline next step (build a team_id to logo URL map)

teams = get_cfb_teams()
logo_map = dict(zip(teams["team_id"], teams["logo"]))

most_recent_cfb_season​

most_recent_cfb_season()

Return the most recent college football season year based on today's date.

The college football season starts in mid-August. If today is on or after August 15 (or any day in September or later), this returns the current calendar year. Otherwise, it returns the previous calendar year.

Returns

The most recent CFB season year.

Example

from sportsdataverse.cfb import most_recent_cfb_season
year = most_recent_cfb_season()
print(year)

# Combine with the loaders for a "current season" pull

from sportsdataverse.cfb import load_cfb_schedule, most_recent_cfb_season
sched = load_cfb_schedule(seasons=[most_recent_cfb_season()])

to_cfbfastr​

to_cfbfastr(pbp: 'pl.DataFrame', *, season: "'Optional[int]'" = None, week: "'Optional[int]'" = None, drives: "'Optional[pl.DataFrame]'" = None, linescore: "'Optional[pl.DataFrame]'" = None, drive_titles: "'Optional[pl.DataFrame]'" = None, ot_drives: "'Optional[pl.DataFrame]'" = None, scoring_summary: "'Optional[pl.DataFrame]'" = None, return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"

cfbfastR-named play frame from the NCAA structural pbp frame.

Parameters

ParameterTypeDefaultDescription
pbpDataFrameOutput of sportsdataverse.cfb.cfb_ncaa_pbp.parse_cfb_ncaa_pbp (one game).
seasonOptional[int]NoneSeason year (2025 = fall-2025), written to season/year.
weekOptional[int]NoneOptional week number (from the schedule master).
drivesOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_drives frame -- refines period per drive when quarter markers are missing from the pbp page.
linescoreOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_linescore frame -- provides home/away team names and the official per-team finals.
drive_titlesOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_pbp.parse_cfb_ncaa_drive_titles frame -- authoritative per-drive team labels (fixes graduated-parser team truncation) and running-score checkpoints the play-level score snaps to at each drive boundary (self-heals OT scoring rules + missed events).
ot_drivesOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_drives frame for the OT-synthesis pass -- overtime rows (period > 4) are selected internally, so the full drives frame can be passed as-is.
scoring_summaryOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_scoring_summary frame -- running-score checkpoints for the synthesized OT rows and the final-drive snap.
return_as_pandasboolFalseReturn a pandas.DataFrame instead of polars.

Returns

A polars.DataFrame (or pandas.DataFrame when return_as_pandas) with one row per play (markers/furniture dropped) and the columns of CFBFASTR_SCHEMA. Empty input returns a zero-row frame carrying the documented schema. Two conventions the NCAA page forces, both matching the ESPN processor: a play wiped out by a penalty ("... NO PLAY.") is typed "Penalty" with every outcome flag False and every yardage column null (it keeps its participants, its penalty_* columns and its spot) -- except fg_made, which is null there as on every row that is not a field-goal attempt; and a try is attributed to the team that scored the touchdown, so a block-printed pair of tries carries a different pos_team per row.

No returns table is published for this function: no capture: its one-game stats.ncaa.org input comes only from a season-sized release or from raw HTML, and the season load runs longer than the capture allows.

Example

from sportsdataverse.cfb import parse_cfb_ncaa_pbp, to_cfbfastr
pbp = parse_cfb_ncaa_pbp(open("play_by_play_5362431.html").read(), contest_id=5362431)
df = to_cfbfastr(pbp, season=2024)
print(df.shape)

# Final score from the running-score columns

df.select("pos_team", "pos_team_score", "def_pos_team", "def_pos_team_score").row(-1)