-
Notifications
You must be signed in to change notification settings - Fork 58
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
[BUG] <title>AttributeError: np.float_
was removed in the NumPy 2.0 release. Use np.float64
instead.
#98
Comments
Tagging onto this issue thread because I just ran into the same problem as well. I implemented a workaround to manage dependency version incompatibilities by modifying the behavior of read_parquet() to default to using the pyarrow engine (instead of the fastparquet engine which is the default when unspecified). This allowed me to sidestep some issues without needing to deal with dependency version changes. Here’s the modification I made at the top of the file where dataframes are read:
I haven't tested this fix with all of the dataframe import functions but it worked for the handful I did test it on. Wanted to add it here for visibility. |
Hey all - while @connor-reidy's patch avoids the title error, there are a ton of API changes in numpy 2.0 and subsequently in pandas 2.0. Unfortunately, some of the changes are less obvious and lead to non-erroring bugs that are difficult to track down, such as what happened in #45. For that reason, I strongly recommend that users stick with numpy and pandas < 2 when using nfl_data_py 0.X. (the upcoming 0.3.3 release will make this a requirement). nfl_data_py 1.0 is in the works, and it will include the upgrade to v2 of both packages once all of those little issues have been worked out. |
Closing as the requirement of numpy < 2.0 and pandas < 2.0 is included in 0.3.3 |
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 have cleared my nflverse cache and the issue persists.
What version of the package do you have?
0.3.2
Describe the bug
The latest version of numpy does not include np.float_, which breaks the import_pbp_data call. Another user linked to a StackOverflow post that suggested the following:
This fixes the issue and allows for the function to work as intended. I wanted to make this post for transparency, so that others who have this bug have a path to solving it.
Reprex
Expected Behavior
Dataframe with data.
nflverse_sitrep
NA
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: