-
Notifications
You must be signed in to change notification settings - Fork 15
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
Preserve coord in reductions that select an element #3377
Comments
Would you convert to an unaligned coord, such that you can still to |
Have you thought about the cost? This would probably be significantly more expensive to implement? |
Yes, I'd think so. This is akin to indexing into an element where we also preserve the coord.
Not in detail. But if we implement it as i = argmax(da.data, dim)
res = da[dim, i] |
One could make it on opt-in keyword arg? |
Possibly. I need to correct my initial list of functions where this can be used: |
Some reductions (
max
,min
,, etc.) select one element along a dimension. It is possible to retain coordinates along that dimension by also selecting the corresponding element. Currently, we simply remove all coords along a reduced dim. But if we changed this, we would get sort of combinedmedian
max
andargmax
, etc. operations. I don't know of a cocnrete use case, it's just something that came to my mind.E.g.
returns
The text was updated successfully, but these errors were encountered: