-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Fix rolling var bug #62514
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
Merged
Merged
Fix rolling var bug #62514
+82
−20
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WillAyd
requested changes
Sep 30, 2025
e4a3939
to
7e5966d
Compare
813d0b9
to
288c5d7
Compare
WillAyd
reviewed
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good - thanks @suzyahyah . Can you also add a whatsnew note describing the fix to the 3.0.0 changelog?
@mroeschke any comments from your end?
mroeschke
reviewed
Oct 3, 2025
288c5d7
to
6431ae5
Compare
mroeschke
approved these changes
Oct 4, 2025
WillAyd
approved these changes
Oct 4, 2025
Great thanks @suzyahyah - nice work! |
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 variance previously had an indexing bug in the end of the window, in
pandas/_libs/window/aggregations.pyx
The implementation now matches numpy rolling variance results, passes "rolling variance correctness" test cases, and all other "rolling_var/std" tests (18/18). It also addresses all of these reported (open) rolling std/var issues
closes
BUG: Rolling variance is negative #52407
BUG: roll_std compute different result when input same data with diffrent length #55343
BUG: Incorrect rolling std #54518
BUG: Rolling std() error #47721
Potentially closes
test_rolling_var_numerical_issues on linux py_3.8_32 failing on MacPython.pandas-wheels #37398
COMPAT/BLD: rolling failed on Arm64 and ppc64le Linux #38921,
TST: Tests broken in ARM #41740
All tests for rolling variance that were previously failing now pass.
Added tests from 52407, 47721, 54518