nflverse / nfl_data_py

Python code for working with NFL play by play data.
MIT License
289 stars 54 forks source link

[BUG] Missing QBR Data #114

Open mawi510 opened 2 months ago

mawi510 commented 2 months ago

Is there an existing issue for this?

Have you installed the latest development version of the package(s) in question?

If this is a data issue, have you tried clearing your nflverse cache?

I am not using an nflverse R package (nflreadr, nflfastR) to access this data.

What version of the package do you have?

0.3.3

Describe the bug

import_qbr doesn't return any data for the 2024 (current) season.

Reprex

import nfl_data_py as nfl
qbr = nfl.import_qbr([2024], 'nfl', 'weekly')
qbr.head()

The above returns an empty dataframe

Expected Behavior

I expected a dataframe similar to what the following would return, but for the current season:

import nfl_data_py as nfl
qbr = nfl.import_qbr([2023], 'nfl', 'weekly')
qbr.head()

nflverse_sitrep

NA

Screenshots

No response

Additional context

No response

alecglen commented 2 months ago

The data source for this method is outdated, it should point to the espn_data feed.

@mawi510 here's a workaround until I can get that fixed.

import pandas as pd

url = "https://github.com/nflverse/nflverse-data/releases/download/espn_data/qbr_week_level.parquet"
qbr = pd.read_parquet(url).loc[lambda x: x.season == 2024].reset_index(drop=True)
mawi510 commented 1 month ago

@alecglen No worries, really appreciate the workaround!