-
-
Notifications
You must be signed in to change notification settings - Fork 11k
ufunc.reduce(..., where=) #8342
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
Comments
Presumably This would be usable in masked arrays as well, right? |
Sounds reasonable, although we'd need to figure it how to handle the case where axis is passed and the mask has inconsistent sizes (leading to a ragged array). |
I'd argue that for consistency with other uses of |
Hmm, the semantics here are ambiguous to me.
Would
I think you were proposing the last one of these, but the semantics of |
To be honest I had not thought about >1d semantics at all. |
|
It would be nice if
ufunc.reduce
gained awhere=...
kwarg (taking either a boolean mask, or a list of indices). This would avoid having to construct an intermediate array in expressions such asnp.max(t[t > 0])
.In particular I wonder whether this would cover most of the difference in the performance of
nansum
(and friends) withbottleneck
.The text was updated successfully, but these errors were encountered: