Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQ] Timport_weekly_data() to pull weekly defensive performances #119

Open
1 task done
sedric11 opened this issue Oct 11, 2024 · 0 comments
Open
1 task done

Comments

@sedric11
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

Currently the offensive stats are pulled into the weekly data. However in daily fantasy sports, a DST position exists where each team's sacks, turnovers recovered, and return touchdowns are also calculated. It would be helpful if that position was returned in the weekly function.

# Function to get weekly data
def get_weekly_data(year):
    year_list = [int(year)]
    df = nfl.import_weekly_data(year_list)
    print(df['position'].value_counts())
    return df

position
WR 614
RB 385
TE 296
QB 195
FB 19
P 3
T 3
SS 1
CB 1

Describe the solution you'd like

Return an aggregate of the team's sacks, fumble recoveries, interceptions, blocked kicks, safeties, kick returns/interception/fumble recoveries when they result in a defensive touchdown, and points allowed to reflect the team's defensive performance for the given week.

Describe alternatives you've considered

No alternative exists in this program that I'm aware of

Additional context

Here is a list of all the relevant defensive stats that are used by draftkings and fanduel for daily fantasy scoring:

Defense -- Sack | +1 Pt Interception | +2 Pts Fumble Recovery | +2 Pts Punt/Kickoff/FG Return for TD | +6 Pts Interception Return TD | +6 Pts Fumble Recovery TD | +6 Pts Blocked Punt or FG Return TD | +6 Pts Safety | +2 Pts Blocked Kick | +2 Pts 2 Pt Conversion/Extra Point Return | +2 Pts 0 Points Allowed | +10 Pts 1 – 6 Points Allowed | +7 Pts 7 – 13 Points Allowed | +4 Pts 14 – 20 Points Allowed | +1 Pt 21 – 27 Points Allowed | +0 Pts 28 – 34 Points Allowed | -1 Pt 35+ Points Allowed | -4 Pts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant