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

improved nan treatment on summing #132

Open
JGuetschow opened this issue Nov 2, 2022 · 1 comment
Open

improved nan treatment on summing #132

JGuetschow opened this issue Nov 2, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request priority: high High priority issue: prioritize and solve as soon as possible

Comments

@JGuetschow
Copy link
Contributor

JGuetschow commented Nov 2, 2022

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

When using ds.pr.sum with skipna=True on data which contains NaN the result is currently 0 if all data points summed over are nan. I usually need functionality where the result is NaN when all input are NaN but if there are one or more non-NaN values the result is the sum of the non-NaN values .

Describe the solution you'd like

Use min_count=1 in the call of ds.sum (in the definition of ds.pr.sum) when skipna=True.

Alternatives
Always pass min_count=1 to ds.pr.sum when using it.

Would there be any problems in existing functionality when introducing this change @mikapfl ?

@JGuetschow JGuetschow added the enhancement New feature or request label Nov 2, 2022
@JGuetschow JGuetschow self-assigned this Nov 2, 2022
@mikapfl
Copy link
Member

mikapfl commented Nov 2, 2022

I don't think this would impact existing functionality and sounds like a sensible default.

@JGuetschow JGuetschow added the priority: high High priority issue: prioritize and solve as soon as possible label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: high High priority issue: prioritize and solve as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants