nfl_data_py icon indicating copy to clipboard operation
nfl_data_py copied to clipboard

PBP data not available for 2022

Open nateb7722 opened this issue 1 year ago • 1 comments
trafficstars

I haven't had this problem before but for some reason I am getting the response "data not available for 2022" from import_pbp function. Running on macOS, python 3.10.13, pandas version 2.2.1

nateb7722 avatar Feb 26 '24 23:02 nateb7722

also not seeing data for 2023....

roe-men avatar Jul 04 '24 14:07 roe-men

Possibly related to your problems, I am seeing a bug with the fastparquet library and numpy versions 2+ related to np.float_ being removed. It was in a fresh installation, python 3.12.4, jupyterlab + nfl_data_py. The final error from nfl data was that the year was not available, but the stack trace showed the actual bug.

I added this to my imports to patch the problem:

import numpy as np

np.float_ = np.float64

Got the suggestion from here: https://stackoverflow.com/a/78721422

Downgrading numpy didn't work.

JonBraund avatar Sep 08 '24 08:09 JonBraund

Thanks for you post Jon — I came here bc I had this issue. I followed the first recommendation in the StackOverflow post where I uninstalled numpy and then used:

pip install "numpy<2"

Posting for transparency

Possibly related to your problems, I am seeing a bug with the fastparquet library and numpy versions 2+ related to np.float_ being removed. It was in a fresh installation, python 3.12.4, jupyterlab + nfl_data_py. The final error from nfl data was that the year was not available, but the stack trace showed the actual bug.

I added this to my imports to patch the problem:

import numpy as np

np.float_ = np.float64

Got the suggestion from here: https://stackoverflow.com/a/78721422

Downgrading numpy didn't work.

Brigidi avatar Sep 09 '24 21:09 Brigidi

@JonBraund that is a separate issue. As discussed in https://github.com/nflverse/nfl_data_py/issues/98#issuecomment-2344408893, I caution against using nfl_data_py with numpy and pandas 2.0+ as they aren't yet supported and multiple issues stemming from the upgrade have been reported. I would downgrade to the latest 1.X versions for now, and keep an eye out for support via nfl_data_py 1.0 later this year!

alecglen avatar Sep 20 '24 02:09 alecglen

@nateb7722, @roe-men - are you still seeing missing 2022 and 2023 data now? I tried with the same python and package versions you specified, but I haven't been able to reproduce that issue yet.

Whether it's related or not, note my comment above regarding avoiding pandas 2.0+ for now.

alecglen avatar Sep 20 '24 02:09 alecglen

using np.float_ = np.float64 worked for me, haven't had this issue since

nateb7722 avatar Sep 20 '24 21:09 nateb7722

@nateb7722 I published a new version of the package last night. You can install it with the command below, and then you shouldn't need the np.float_ = np.float64 patch anymore.

pip install --force-reinstall nfl_data_py==0.3.3

If you encounter that issue again with the new version, let me know and I'll re-open your ticket.

alecglen avatar Sep 20 '24 21:09 alecglen

@nateb7722 I published a new version of the package last night. You can install it with the command below, and then you shouldn't need the np.float_ = np.float64 patch anymore.

pip install --force-reinstall nfl_data_py==0.3.3

If you encounter that issue again with the new version, let me know and I'll re-open your ticket.

Thank you, the change you made helped downgrade the dependencies in my environment properly. It seems to have resolved some other strange behaviour.

JonBraund avatar Sep 22 '24 06:09 JonBraund