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

pandas warning about .apply(sum) #21

Open
zmoon opened this issue Apr 9, 2024 · 1 comment
Open

pandas warning about .apply(sum) #21

zmoon opened this issue Apr 9, 2024 · 1 comment
Milestone

Comments

@zmoon
Copy link
Collaborator

zmoon commented Apr 9, 2024

area = time_groups[["area_km2", "area219_km2"]].apply(sum)

May be able to just use .sum() instead. Or pandas suggests switching to .apply('np.sum') to keep the current behavior.

@zmoon zmoon added this to the v0.2 milestone Apr 9, 2024
@zmoon
Copy link
Collaborator Author

zmoon commented May 30, 2024

Also seeing a corresponding warning with this in some envs:

numpy/core/fromnumeric.py:86: FutureWarning: The behavior of DataFrame.sum with axis=None is deprecated, in a future version this will reduce over both axes and return a scalar. To retain the old behavior, pass axis=0 (or do not pass axis)

which seems to be really a pandas 2 thing.

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