fantasyfootball.benchmarking

Module Contents

Functions

filter_to_prior_week(→ pandas.DataFrame)

Filter all data up until the most recently

score_benchmark_data(→ pandas.DataFrame)

Add point projection based on predictions from:

get_benchmarking_data(→ pandas.DataFrame)

fantasyfootball.benchmarking.filter_to_prior_week(df: pandas.DataFrame, season_year: int, week_number: int) pandas.DataFrame[source]
Filter all data up until the most recently

completed week.

Parameters:
  • df (pd.DataFrame) – Historical data and features.

  • season_year (int) – Year of the season.

  • week_number (int) – Week number of the most recently completed week.

Returns:

Historical data and features.

Return type:

pd.DataFrame

fantasyfootball.benchmarking.score_benchmark_data(benchmark_df: pandas.DataFrame, scoring_source: str) pandas.DataFrame[source]

Add point projection based on predictions from: https://fantasydata.com/nfl/fantasy-football-weekly-projections for use in benchmarking.

Parameters:
  • benchmark_df (pd.DataFrame) – Weekly player predictions from fantasydata.com.

  • scoring_source (str) – Name of the scoring system to apply (e.g., ‘yahoo’).

Returns:

Weekly player predictions from

fantasydata converted to scoring system.

Return type:

pd.DataFrame

fantasyfootball.benchmarking.get_benchmarking_data(season_year_start: int, season_year_end: int, base_url: str = 'https://raw.githubusercontent.com/thecodeforest/fantasyfootball/main/examples/benchmarking_data/season/') pandas.DataFrame[source]