Skip to main content
Version: 0.2.0

NFL — additional Python functions — nflverse data releases: rosters_weekly–trades

load_rosters_weekly​

load_rosters_weekly(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL weekly roster data for the requested seasons.

Reads nflverse's published weekly-roster parquet (one row per player per team per week), so the roster snapshot reflects mid-season transactions (signings, releases, IR moves) rather than a single season-end view. Like load_nfl_rosters it is sourced from nflverse's full multi-tier roster product and carries densely populated cross-system identifier columns plus a week / game_type pair identifying each snapshot.

Unlike load_nfl_rosters and load_nfl_players, this loader has no SDV-native (source="sdv") tier: the SDV roster build (build_nfl_rosters) is season-only, and weekly snapshots require the credential-gated NFL Data Exchange that the public build cannot reach.

Parameters

ParameterTypeDefaultDescription
seasonslistSeasons to load (e.g. [2024] or range(2022, 2025)). A single int is accepted and wrapped. 2002 is the earliest available season. None loads the current season, True every published season, and [] an empty frame (no request).
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe (default).

Returns

Polars dataframe of weekly rosters for the requested seasons (pandas.DataFrame when return_as_pandas=True). seasons=[] gives an empty frame with no columns; schema'd empty frames come with the dtype contract.

col_nametypedescription
seasonInt64NFL season (year) the weekly roster snapshot applies to.
teamStringTeam abbreviation in the nflverse standard (relocations folded, e.g. 'OAK' -> 'LV', 'SD' -> 'LAC', 'STL' -> 'LA').
positionStringPosition the player is listed at on the roster (e.g. 'QB', 'WR', 'CB').
depth_chart_positionStringFine-grained depth-chart position label, which may differ from the broader position group.
jersey_numberInt64Uniform (jersey) number the player wears.
statusStringRoster status code for the player (e.g. 'ACT' active, 'INA' inactive, 'RES' reserve/injured).
full_nameStringPlayer's full display name.
first_nameStringPlayer's first (given) name.
last_nameStringPlayer's last (family) name.
birth_dateDatePlayer's date of birth (YYYY-MM-DD).
heightFloat64Player's height in inches.
weightInt64Player's listed weight in pounds.
collegeStringCollege or university the player attended.
gsis_idStringNFL GSIS player identifier — the canonical nflverse player key used to join across datasets.
espn_idStringESPN player identifier for cross-system joins.
sportradar_idStringSportradar player identifier for cross-system joins.
yahoo_idStringYahoo Sports player identifier for cross-system joins.
rotowire_idStringRotoWire player identifier for cross-system joins.
pff_idStringPro Football Focus (PFF) player identifier for cross-system joins.
pfr_idStringPro Football Reference (PFR) player identifier for cross-system joins.
fantasy_data_idStringFantasyData player identifier for cross-system joins.
sleeper_idStringSleeper player identifier for cross-system joins.
years_expInt64Number of accrued NFL seasons of experience for the player.
headshot_urlStringURL of the player's headshot image.
ngs_positionStringPlayer's position as classified by NFL Next Gen Stats.
weekInt64Week of the season the weekly roster snapshot applies to.
game_typeStringType of game the weekly roster snapshot applies to (e.g. 'REG', 'POST').
status_description_abbrStringAbbreviated roster status description code from the source feed.
football_nameStringPlayer's preferred football (commonly used) first name.
esb_idStringElias Sports Bureau (ESB) player identifier used for official NFL record-keeping.
gsis_it_idStringNFL GSIS internal tracking identifier for the player.
smart_idStringNFL SMART player identifier (GUID) used across modern NFL data feeds.
entry_yearInt64Calendar year the player first entered the NFL.
rookie_yearInt64Calendar year of the player's rookie season.
draft_clubStringTeam abbreviation of the club that drafted the player.
draft_numberInt64Overall pick number at which the player was selected in the NFL draft.

Raises

ExceptionDescription
SeasonNotFoundErrorIf a requested season precedes the earliest available season (2002).

Example

from sportsdataverse.nfl import load_nfl_weekly_rosters
weekly = load_nfl_weekly_rosters(seasons=[2024])

# Multi-season range with a follow-up week filter

import polars as pl
wk1 = (
load_nfl_weekly_rosters(seasons=range(2022, 2025))
.filter(pl.col("week") == 1)
)

load_schedules​

load_schedules(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL schedule data

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season. None loads the current season, True every published season, and [] an empty frame (no request).
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing the schedule for the requested seasons. seasons=[] gives an empty frame with no columns; schema'd empty frames come with the dtype contract.

col_nametypedescription
game_idStringTen digit identifier for NFL game.
seasonInt644 digit number indicating to which season(s) the specified timeframe belongs to.
game_typeStringThe most recent game type of that season that a player appeared on the roster.
weekInt64Season week.
gamedayStringThe date on which the game occurred.
weekdayStringThe day of the week on which the game occcured.
gametimeStringThe kickoff time of the game. This is represented in 24-hour time and the Eastern time zone, regardless of what time zone the game was being played in.
away_teamStringString abbreviation for the away team.
away_scoreInt64The number of points the away team scored. Is NA for games which haven't yet been played.
home_teamStringThe home team. Note that this contains the designated home team for games which no team is playing at home such as Super Bowls or NFL International games.
home_scoreInt64The number of points the home team scored. Is NA for games which haven't yet been played.
locationStringEither Home if the home team is playing in their home stadium, or Neutral if the game is being played at a neutral location. This still shows as Home for games between the Giants and Jets even though they share the same home stadium.
resultInt64The number of points the home team scored minus the number of points the visiting team scored. Equals h_score - v_score. Is NA for games which haven't yet been played. Convenient for evaluating against the spread bets.
totalInt64The sum of each team's score in the game. Equals h_score + v_score. Is NA for games which haven't yet been played. Convenient for evaluating over/under total bets.
overtimeInt64Binary indicator of whether or not game went to overtime.
old_game_idStringLegacy NFL game ID.
gsisInt64The id of the game issued by the NFL Game Statistics & Information System.
nfl_detail_idStringThe id of the game issued by NFL Detail.
pfrStringThe id of the game issued by Pro-Football-Reference
pffInt64The id of the game issued by Pro Football Focus
espnStringThe id of the game issued by ESPN
ftnInt64FTN Data game identifier used to join schedule records with FTN charting and tracking data.
away_restInt64Days of rest that the away team is coming off of.
home_restInt64Days of rest that the home team is coming off of.
away_moneylineInt64Odds for away team to win the game.
home_moneylineInt64Odds for home team to win the game.
spread_lineFloat64The closing spread line for the game. A positive number means the home team was favored by that many points, a negative number means the away team was favored by that many points. (Source: Pro-Football-Reference)
away_spread_oddsInt64Odds for away team to cover the spread.
home_spread_oddsInt64Odds for home team to cover the spread.
total_lineFloat64The closing total line for the game. (Source: Pro-Football-Reference)
under_oddsInt64Odds that total score of game would be under the total_line.
over_oddsInt64Odds that total score of game would be over the total_ine.
div_gameInt64Binary indicator of whether or not game was played by 2 teams in the same division.
roofStringOne of 'dome', 'outdoors', 'closed', 'open' indicating indicating the roof status of the stadium the game was played in. (Source: Pro-Football-Reference)
surfaceStringWhat type of ground the game was played on. (Source: Pro-Football-Reference)
tempInt64The temperature at the stadium only for 'roof' = 'outdoors' or 'open'.(Source: Pro-Football-Reference)
windInt64The speed of the wind in miles/hour only for 'roof' = 'outdoors' or 'open'. (Source: Pro-Football-Reference)
away_qb_idStringGSIS Player ID for away team starting quarterback.
home_qb_idStringGSIS Player ID for home team starting quarterback.
away_qb_nameStringName of away team starting QB.
home_qb_nameStringName of home team starting QB.
away_coachStringFirst and last name of the away team coach. (Source: Pro-Football-Reference)
home_coachStringFirst and last name of the home team coach. (Source: Pro-Football-Reference)
refereeStringName of the game's referee (head official)
stadium_idStringID of the stadium the game was played in. (Source: Pro-Football-Reference)
stadiumStringName of the stadium

Raises

ExceptionDescription
ValueErrorIf season is less than 1999.

Example

from sportsdataverse.nfl import load_nfl_schedule
schedule = load_nfl_schedule(seasons=[2024])
schedule.shape

# Multi-season range

schedule = load_nfl_schedule(seasons=range(2020, 2025))

# Filter to a single week

import polars as pl
week_one = load_nfl_schedule(seasons=[2024]).filter(pl.col("week") == 1)

# Pandas round-trip

schedule_pd = load_nfl_schedule(seasons=[2024], return_as_pandas=True)
schedule_pd[["game_id", "home_team", "away_team", "week"]].head()

load_snap_counts​

load_snap_counts(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL snap counts data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2012 is the earliest available season. None loads the current season, True every published season, and [] an empty frame (no request).
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing snap counts available for the requested seasons. seasons=[] gives an empty frame with no columns; schema'd empty frames come with the dtype contract.

col_nametypedescription
game_idStringTen digit identifier for NFL game.
pfr_game_idStringPFR game ID
seasonInt644 digit number indicating to which season(s) the specified timeframe belongs to.
game_typeStringThe most recent game type of that season that a player appeared on the roster.
weekInt64Season week.
playerStringPlayer name
pfr_player_idStringID from Pro Football Reference
positionStringPrimary position as reported by NFL.com
teamStringNFL team. Uses official abbreviations as per NFL.com
opponentStringOpposing team of player
offense_snapsFloat64Number of snaps on offense
offense_pctFloat64Percent of offensive snaps taken
defense_snapsFloat64Number of snaps on defense
defense_pctFloat64Percent of defensive snaps taken
st_snapsFloat64Number of snaps on special teams
st_pctFloat64Percent of special teams snaps taken

Example

from sportsdataverse.nfl import load_nfl_snap_counts
snaps = load_nfl_snap_counts(seasons=[2024])

# Multi-season range with offense-only filter

import polars as pl
offense = (
load_nfl_snap_counts(seasons=range(2022, 2025))
.filter(pl.col("offense_snaps") > 0)
)

load_team_stats​

load_team_stats(seasons: 'List[int]', summary_level: 'str' = 'week', return_as_pandas=False, *, source: 'str' = 'nflverse') -> 'pl.DataFrame'

Load NFL team stats data going back to 1999

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season. None loads the current season, True every published season, and [] an empty frame (no request).
summary_levelstr'week'Aggregation level. One of "week", "reg", "post", "reg+post". Defaults to "week". Ignored when source is the SDV-native release (a single week-level parquet covering all seasons; filter post-load).
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.
sourcestr'nflverse'Which team-stats release to read. "nflverse" (the default) reads the per-season nflverse stats_team releases. "sportsdataverse" / "sdv" reads the SDV-native nfl_team_stats release (a single combined week-level parquet, built by sportsdataverse.nfl.build_nfl_team_stats from the SDV play-by-play and filtered to the requested seasons post-load).

Returns

Polars dataframe containing team stats available for the requested seasons. seasons=[] gives an empty frame with no columns; schema'd empty frames come with the dtype contract.

col_nametypedescription
seasonInt644 digit number indicating to which season(s) the specified timeframe belongs to.
weekInt64Season week.
teamStringNFL team. Uses official abbreviations as per NFL.com
season_typeStringREG or POST indicating if the timeframe belongs to regular or post season.
game_idStringTen digit identifier for NFL game.
opponent_teamStringAbbreviation of the opposing team the team faced in the game or week represented by this row.
completionsInt64The number of completed passes.
attemptsInt64The number of pass attempts as defined by the NFL.
passing_yardsInt64Numeric yards by the passer_player_name, including yards gained in pass plays with laterals. This should equal official passing statistics.
passing_tdsInt64The number of passing touchdowns.
passing_interceptionsInt64Total number of interceptions thrown by the team's quarterbacks during the period covered.
sacks_sufferedInt64Total number of times the team's quarterback was sacked during the period covered.
sack_yards_lostInt64Total yards lost by the team's offense as a result of being sacked.
sack_fumblesInt64The number of sacks with a fumble.
sack_fumbles_lostInt64The number of sacks with a lost fumble.
passing_air_yardsInt64Passing air yards (includes incomplete passes).
passing_yards_after_catchInt64Yards after the catch gained on plays in which player was the passer (this is an unofficial stat and may differ slightly between different sources).
passing_first_downsInt64First downs on pass attempts.
passing_epaFloat64Total expected points added on pass attempts and sacks. NOTE: this uses the variable qb_epa, which gives QB credit for EPA for up to the point where a receiver lost a fumble after a completed catch and makes EPA work more like passing yards on plays with fumbles.
passing_cpoeFloat64Completion percentage over expectation for the team's passing game — how much better or worse actual completion rate was versus the model-predicted rate. Percentage points (100 * the completion-rate gap), not a 0-1 rate.
passing_2pt_conversionsInt64Two-point conversion passes.
passing_10Int64Number of the team's completed passes that gained 10 or more yards (one of nflfastR's 'explosive' play thresholds).
passing_16Int64Number of the team's completed passes that gained 16 or more yards (one of nflfastR's 'explosive' play thresholds).
passing_20Int64Number of the team's completed passes that gained 20 or more yards (one of nflfastR's 'explosive' play thresholds).
passing_40Int64Number of the team's completed passes that gained 40 or more yards (one of nflfastR's 'explosive' play thresholds).
carriesInt64The number of official rush attempts (incl. scrambles and kneel downs). Rushes after a lateral reception don't count as carry.
rushing_yardsInt64Numeric yards by the rusher_player_name, excluding yards gained in rush plays with laterals. This should equal official rushing statistics but could miss yards gained in rush plays with laterals. Please see the description of lateral_rusher_player_name for further information.
rushing_tdsInt64The number of rushing touchdowns (incl. scrambles). Also includes touchdowns after obtaining a lateral on a play that started with a rushing attempt.
rushing_fumblesInt64The number of rushes with a fumble.
rushing_fumbles_lostInt64The number of rushes with a lost fumble.
rushing_first_downsInt64First downs on rush attempts (incl. scrambles).
rushing_epaFloat64Expected points added on rush attempts (incl. scrambles and kneel downs).
rushing_2pt_conversionsInt64Two-point conversion rushes
rushing_10Int64Number of the team's runs that gained 10 or more yards (one of nflfastR's 'explosive' play thresholds).
rushing_12Int64Number of the team's runs that gained 12 or more yards (one of nflfastR's 'explosive' play thresholds).
rushing_20Int64Number of the team's runs that gained 20 or more yards (one of nflfastR's 'explosive' play thresholds).
rushing_40Int64Number of the team's runs that gained 40 or more yards (one of nflfastR's 'explosive' play thresholds).
receptionsInt64The number of pass receptions. Lateral receptions officially don't count as reception.
targetsInt64The number of pass plays where the player was the targeted receiver.
receiving_yardsInt64Numeric yards by the receiver_player_name, excluding yards gained in pass plays with laterals. This should equal official receiving statistics but could miss yards gained in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
receiving_tdsInt64The number of touchdowns following a pass reception. Also includes touchdowns after receiving a lateral on a play that started as a pass play.
receiving_fumblesInt64The number of fumbles after a pass reception.
receiving_fumbles_lostInt64The number of fumbles lost after a pass reception.
receiving_air_yardsInt64Receiving air yards (incl. incomplete passes).
receiving_yards_after_catchInt64Yards after the catch gained on plays in which player was receiver (this is an unofficial stat and may differ slightly between different sources).
receiving_first_downsInt64Total number of first downs gained on receptions
receiving_epaFloat64Total EPA on plays where this receiver was targeted
receiving_2pt_conversionsInt64Two-point conversion receptions
receiving_10Int64Number of the team's receptions that gained 10 or more yards (one of nflfastR's 'explosive' play thresholds).
receiving_16Int64Number of the team's receptions that gained 16 or more yards (one of nflfastR's 'explosive' play thresholds).
receiving_20Int64Number of the team's receptions that gained 20 or more yards (one of nflfastR's 'explosive' play thresholds).
receiving_40Int64Number of the team's receptions that gained 40 or more yards (one of nflfastR's 'explosive' play thresholds).
special_teams_tdsInt64Total number of kick/punt return touchdowns
def_tackles_soloInt64Total number of solo tackles for this player
def_tackles_with_assistInt64Number of tackles this player had with an assisted tackle
def_tackle_assistsInt64Number of assisted tackles for this player
def_tackles_for_lossInt64Number of tackles for loss (TFL) for this player
def_tackles_for_loss_yardsInt64Yards lost from TFLs involving this player
def_fumbles_forcedInt64Number of times a fumble was forced from this player
def_sacksFloat64Number of sacks form this player
def_sack_yardsFloat64Yards lost from sacks forced by this player
def_qb_hitsInt64Number of QB hits from this player (should not include plays where the QB was sacked)
def_interceptionsInt64Number of interceptions forced by this player
def_interception_yardsInt64yards gained/lost by interception returns from this player
def_pass_defendedInt64Number of passes defended/broken up by this player
def_tdsInt64Number of defensive touchdowns scored by this player
def_fumblesInt64Number of fumbles by this player
def_safetiesInt64Number of safeties recorded by the team's defense (tackling an opponent in their own end zone).
def_punt_blocksInt64Number of opponent punts blocked by the team's defense.
def_pat_blocksInt64Number of opponent extra point attempts blocked by the team's defense.
def_fg_blocksInt64Number of opponent field goal attempts blocked by the team's defense.
def_2pt_attsInt64Number of defensive two-point conversion returns attempted by the team (nflfastR stat id 403).
def_2pt_madeInt64Number of successful defensive two-point conversion returns by the team (nflfastR stat id 404).
misc_yardsInt64Yards gained by the team through miscellaneous means not captured in standard rushing, passing, or return categories.
fumble_recovery_ownInt64Number of the team's own fumbles that were recovered by the team itself.
fumble_recovery_yards_ownInt64Total yards gained after recovering their own fumbles.
fumble_recovery_oppInt64Number of fumbles recovered by the team from the opposing offense (defensive fumble recoveries).
fumble_recovery_yards_oppInt64Total yards gained by the team on returns of opponent fumble recoveries.
fumble_recovery_tdsInt64Number of touchdowns scored by the team on fumble recoveries (own or opponent).
penaltiesInt64
penalty_yardsInt64Yards gained (or lost) by the posteam from the penalty.
timeoutsInt64Number of timeouts remaining or used by the team during the game or period covered.
fumbles_forced_by_oppInt64Fumbles by the team's players that were forced by the opponent, counted across all units (offense, defense and special teams).
fumbles_not_forcedInt64Fumbles by the team's players that were not forced by the opponent, counted across all units.
fumbles_out_of_boundsInt64Fumbles by the team's players where the ball went out of bounds, forced or not; each is also counted in fumbles_forced_by_opp or fumbles_not_forced.
fumbles_totalInt64Total fumbles by the team's players across all units; equals fumbles_forced_by_opp + fumbles_not_forced.
fumbles_lost_totalInt64Total fumbles lost by the team's players, counted across all units.
punt_returnsInt64
punt_return_yardsInt64
kickoff_returnsInt64Total number of kickoff return attempts by the team.
kickoff_return_yardsInt64Total yards gained by the team on kickoff returns during the period covered.
fg_madeInt64
fg_attInt64Total field goal attempts by the team's kicker during the period covered.
fg_missedInt64Total number of field goal attempts that were missed (not blocked, not made) by the team's kicker.
fg_blockedInt64Total number of field goal attempts that were blocked by the opposing defense.
fg_longInt64Distance in yards of the team's longest successful field goal during the period covered.
fg_pctFloat64
fg_made_0_19Int64Number of field goals made by the team from 0–19 yards.
fg_made_20_29Int64Number of field goals made by the team from 20–29 yards.
fg_made_30_39Int64Number of field goals made by the team from 30–39 yards.
fg_made_40_49Int64Number of field goals made by the team from 40–49 yards.
fg_made_50_59Int64Number of field goals made by the team from 50–59 yards.
fg_made_60_Int64Number of field goals made by the team from 60 yards or longer.
fg_missed_0_19Int64Number of field goal attempts missed from 0–19 yards.
fg_missed_20_29Int64Number of field goal attempts missed from 20–29 yards.
fg_missed_30_39Int64Number of field goal attempts missed from 30–39 yards.
fg_missed_40_49Int64Number of field goal attempts missed from 40–49 yards.
fg_missed_50_59Int64Number of field goal attempts missed from 50–59 yards.
fg_missed_60_Int64Number of field goal attempts missed from 60 yards or longer.
fg_made_listStringComma-separated list of distances (in yards) for each successful field goal made by the team.
fg_missed_listStringComma-separated list of distances (in yards) for each missed field goal attempt by the team.
fg_blocked_listStringComma-separated list of distances (in yards) for field goal attempts blocked by or against the team.
fg_made_distanceInt64Total cumulative distance in yards of all successful field goals made by the team.
fg_missed_distanceInt64Total cumulative distance in yards of all missed field goal attempts by the team.
fg_blocked_distanceInt64Distance in yards of the most recent or representative blocked field goal attempt.
pat_madeInt64Total number of extra points successfully kicked by the team.
pat_attInt64Total number of extra point (PAT) kick attempts by the team.
pat_missedInt64Number of extra point kick attempts that were missed (neither made nor blocked).
pat_blockedInt64Number of extra point attempts that were blocked by the opposing defense.
pat_pctFloat64Extra point conversion percentage (pat_made divided by pat_att) for the team's kicker.
gwfg_madeInt64Number of game-winning field goals successfully converted by the team's kicker.
gwfg_attInt64Number of game-winning field goal attempts (potential go-ahead kicks in the final moments).
gwfg_missedInt64Number of game-winning field goal attempts that were missed by the team's kicker.
gwfg_blockedInt64Number of game-winning field goal attempts that were blocked by the opposing defense.
gwfg_distanceInt64Distance in yards of the game-winning field goal attempt(s) during the period covered.
pt_attInt64Number of punts kicked by the team; blocked punts are counted separately in pt_blocked.
pt_blockedInt64Number of the team's punts that were blocked.
pt_longInt64Length in yards of the team's longest punt; null when the team had no kicked punt (never 0 in the 2024 sample).
pt_yardsInt64Total gross yards of the team's punts.
pt_inside_20Int64Number of the team's punts credited as ending inside the opponent's 20-yard line (nflfastR defines the spot as where the return ended).
pt_out_of_boundsInt64Number of the team's punts that went out of bounds without a return.
pt_downedInt64Number of the team's punts that were downed without a return.
pt_touchbackInt64Number of the team's punts that resulted in a touchback.
pt_fair_caughtInt64Number of the team's punts that were fair caught by the opponent.
pt_returnedInt64Number of the team's punts that were returned by the opponent.
pt_return_yardsInt64Punt return yards gained by the opponent on the team's punts; can be negative (minimum -4 in the 2024 sample).
pt_return_tdsInt64Number of the team's punts that the opponent returned for a touchdown.
pt_net_yardsInt64Net punting yards: pt_yards minus pt_return_yards minus 20 yards per touchback.

Raises

ExceptionDescription
ValueErrorIf season is less than 1999, if summary_level is not one of the allowed values, or if source is not one of "nflverse", None, "sportsdataverse", or "sdv".

Example

from sportsdataverse.nfl import load_nfl_team_stats
weekly = load_nfl_team_stats(seasons=[2024])

# Regular-season-only team stats

reg = load_nfl_team_stats(seasons=[2024], summary_level="reg")

# SDV-native team stats (built from SDV play-by-play)

sdv = load_nfl_team_stats(seasons=[2024], source="sdv")

load_teams​

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

Load NFL 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_abbrStringOfficial team abbreveation
team_nameString
team_idInt64
team_nickStringTeam nickname or mascot name (e.g., 'Chiefs', 'Patriots').
team_confStringConference the team belongs to (e.g., 'AFC', 'NFC').
team_divisionStringDivision within the conference the team belongs to (e.g., 'AFC East').
team_colorString
team_color2StringSecondary brand color for the team, expressed as a hex color code.
team_color3StringTertiary brand color for the team, expressed as a hex color code.
team_color4StringQuaternary brand color for the team, expressed as a hex color code.
team_logo_wikipediaStringURL of the team's logo image as hosted on Wikipedia.
team_logo_espnStringURL of the team's primary logo as hosted on ESPN.
team_wordmarkStringURL of the team's wordmark (text-based logo) image.
team_conference_logoStringURL of the conference logo image associated with the team.
team_league_logoStringURL of the NFL league logo image.
team_logo_squaredStringURL of a square-format version of the team's logo.

Example

from sportsdataverse.nfl import load_nfl_teams
teams = load_nfl_teams()
teams.shape

# Pandas round-trip

teams_pd = load_nfl_teams(return_as_pandas=True)
teams_pd[["team_abbr", "team_name", "team_conf", "team_division"]].head()

load_trades​

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

Load NFL trades data

Parameters

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

Returns

Polars dataframe containing NFL trade information.

col_nametypedescription
trade_idInt64ID of Trade
seasonInt644 digit number indicating to which season(s) the specified timeframe belongs to.
trade_dateDateExact date that trade occurred
gaveStringTeam that gave pick/player in row
receivedStringTeam that received pick/player in row
pick_seasonInt64Draft in which traded pick was in
pick_roundInt64Round in which traded pick was in
pick_numberInt64Pick number of traded pick
conditionalInt64Binary indicator of whether or not traded pick was conditional
pfr_idStringPro-Football-Reference ID for player
pfr_nameStringFull name of traded player

Example

from sportsdataverse.nfl import load_nfl_trades
trades = load_nfl_trades()
trades.shape

# Filter to a single season

import polars as pl
trades_2024 = load_nfl_trades().filter(pl.col("season") == 2024)