Repository navigation
Don't count the padding in the indices of rolling argmin/argmax - #11696
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rolling
argmin/argmaxreturn the position within the padded window, so windows that extend beyond the array count the padding. This is most visible forcumulative, whose windows span the whole dimension:da.cumulative("time").argmax()returned[4, 4, 3, 4, 4]instead of[0, 1, 1, 3, 4]for[1, 2, 1.5, 3.5, 4].Rolling.__iter__. Interior windows are unchanged, andcumulativereturns absolute indices without needing a special case.DataArrayRolling._array_reduce, so it applies to the numpy, bottleneck and dask paths, and toDataset.Supersedes #11412.
whats-new.rstAI Disclosure
Tools: Claude Code
[This is Claude Code on behalf of Michael Niklas]
🤖 Generated with Claude Code