-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
BUG: Fix rolling().mean() returning NaNs on reassignment (#61841) #61845
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
Closed
abujabarmubarak
wants to merge
158
commits into
pandas-dev:main
from
abujabarmubarak:fix-rolling-mean-nan
Closed
BUG: Fix rolling().mean() returning NaNs on reassignment (#61841) #61845
abujabarmubarak
wants to merge
158
commits into
pandas-dev:main
from
abujabarmubarak:fix-rolling-mean-nan
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
…re) (#56612) Backport PR #56595: TST/CLN: Inline seldom used fixture Co-authored-by: Matthew Roeschke <[email protected]>
…6620) Backport PR #56615: CI: Fix deprecation warnings Co-authored-by: Patrick Hoefler <[email protected]>
…#56624) Backport PR #56617: TYP: some return types from ruff Co-authored-by: Torsten Wörtwein <[email protected]>
Backport PR #56636: DOC: Fixup CoW userguide Co-authored-by: Patrick Hoefler <[email protected]>
…new) (#56640) Backport PR #56632: DOC: Minor fixups for 2.2.0 whatsnew Co-authored-by: Richard Shadrach <[email protected]>
…arrow floats to numpy floats) (#56648) Backport PR #56644: BUG: Series.to_numpy raising for arrow floats to numpy floats Co-authored-by: Patrick Hoefler <[email protected]>
…rrow duration types) (#56656) Backport PR #56650: ENH: Implement dt methods for pyarrow duration types Co-authored-by: Matthew Roeschke <[email protected]>
…56655) Backport PR #56647: floordiv fix for large values Co-authored-by: rohanjain101 <[email protected]>
…atetime columns with timedelta columns) (#56658) Backport PR #56613: BUG: Added raising when merging datetime columns with timedelta columns Co-authored-by: Huanghz2001 <[email protected]>
…x raising read-only error) (#56660) Backport PR #56635: CoW: Boolean indexer in MultiIndex raising read-only error Co-authored-by: Patrick Hoefler <[email protected]>
…ble in 2.2 whatsnew) (#56662) Backport PR #56641: DOC: Add optional dependencies table in 2.2 whatsnew Co-authored-by: Matthew Roeschke <[email protected]>
…type) (#56665) Backport PR #56370: BUG: rolling with datetime ArrowDtype Co-authored-by: Matthew Roeschke <[email protected]>
…erly respecting check-dtype) (#56668) Backport PR #56654: BUG: assert_series_equal not properly respecting check-dtype Co-authored-by: Patrick Hoefler <[email protected]>
…6669) Backport PR #56664: CI: Run jobs on 2.2.x branch Co-authored-by: Matthew Roeschke <[email protected]>
…heck for future annotation import) (#56683) Backport PR #56666: STY: Use ruff instead of pygrep check for future annotation import Co-authored-by: Matthew Roeschke <[email protected]>
Backport PR #56682: CLN: NEP 50 followups Co-authored-by: Thomas Li <[email protected]>
…ession) (#56686) Backport PR #56312: DOC: Add whatsnew for concat regression Co-authored-by: Thomas Li <[email protected]>
…ries.struct.field) (#56698) Backport PR #56167: [ENH]: Expand types allowed in Series.struct.field Co-authored-by: Tom Augspurger <[email protected]>
….fullmatch matches partial string. issue #56652) (#56715) Backport PR #56691: Bug pyarrow implementation of str.fullmatch matches partial string. issue #56652 Co-authored-by: JackCollins91 <[email protected]>
… coerce) (#56719) Backport PR #56699: DOC: Corrected typo in warning on coerce Co-authored-by: aaron-robeson-8451 <[email protected]>
…fill) (#56720) Backport PR #56616: BUG: Add limit_area to EA ffill/bfill Co-authored-by: Richard Shadrach <[email protected]>
…56725) Backport PR #56721: DOC: Fixup read_csv docstring Co-authored-by: Patrick Hoefler <[email protected]>
…orical using dictionary as categories) (#56723) Backport PR #56672: BUG: dictionary type astype categorical using dictionary as categories Co-authored-by: Patrick Hoefler <[email protected]>
…cel) (#56730) Backport PR #56543: DOC: Update docstring for read_excel Co-authored-by: Patrick Hoefler <[email protected]>
… for pyarrow types with large divisor and avoid floating points for floordiv) (#56744) Backport PR #56677: Fix integral truediv and floordiv for pyarrow types with large divisor and avoid floating points for floordiv Co-authored-by: rohanjain101 <[email protected]>
…vation in groupby column selection) (#56770) Backport PR #56761: BUG: fix subclass metadata preservation in groupby column selection Co-authored-by: Joris Van den Bossche <[email protected]>
… bools for ea dtypes) (#56780) Backport PR #56769: BUG: replace matching Floats with bools for ea dtypes Co-authored-by: Patrick Hoefler <[email protected]>
…lable bool dtype) (#56782) Backport PR #56767: BUG: Series.round raising for nullable bool dtype Co-authored-by: Patrick Hoefler <[email protected]>
…pes correctly) (#56783) Backport PR #56771: BUG: to_stata not handling ea dtypes correctly Co-authored-by: Patrick Hoefler <[email protected]>
Backport PR #57821: Fix doc build Co-authored-by: Trinh Quoc Anh <[email protected]>
….rst) (#57832) Backport PR #57830: DOC: Pin dask/dask-expr for scale.rst Co-authored-by: Matthew Roeschke <[email protected]>
…ion) (#57834) Backport PR #57796: Fix issue with Tempita recompilation Co-authored-by: William Ayd <[email protected]>
…normalize from docs) (#57854) Backport PR #57848: DOC: Remove duplicated Series.dt.normalize from docs Co-authored-by: Marc Garcia <[email protected]>
…in favor of linking to ecosystem docs. (#57861) Co-authored-by: Yuki Kitayama <[email protected]>
…57898) Backport PR #57892: CI: xfail Pyarrow slicing test Co-authored-by: Matthew Roeschke <[email protected]>
…ith Dask, dict-like, Series) (#57899) Backport PR #57889: BUG: Handle Series construction with Dask, dict-like, Series Co-authored-by: Matthew Roeschke <[email protected]>
…compilation (#57796)") (#57907) Backport PR #57905: Revert "Fix issue with Tempita recompilation (#57796)" Co-authored-by: William Ayd <[email protected]>
Backport PR #57886: CI: Remove ASAN job Co-authored-by: William Ayd <[email protected]>
…hod) (#57940) Backport PR #57029: DOC: Add `DataFrame.to_numpy` method Co-authored-by: Zhengbo Wang <[email protected]>
…orted in the interchange protocol) (#57947)
…for to_datetime(str, unit=...)) (#58034) Backport PR #57548: Fix accidental loss-of-precision for to_datetime(str, unit=...) Co-authored-by: Elliott Sales de Andrade <[email protected]>
…ol errors on Boolean columns) (#58036) Backport PR #57758: BUG: DataFrame Interchange Protocol errors on Boolean columns Co-authored-by: Marco Edward Gorelli <[email protected]>
…f table when using public schema) (#58050) Backport PR #57974: BUG: Fixed ADBC to_sql creation of table when using public schema Co-authored-by: Shabab Karim <[email protected]>
…58080) Backport PR #58075: DOC: whatsnew note for #57553 Co-authored-by: jbrockmendel <[email protected]>
…ifulsoup4 4.13.0b2) (#58137) Backport PR #58100: MNT: fix compatibility with beautifulsoup4 4.13.0b2 Co-authored-by: Clément Robert <[email protected]>
…58140) Backport PR #58138: BLD: Fix nightlies not building Co-authored-by: Thomas Li <[email protected]>
…rc1) (#58105) Backport PR #58087: BLD: Build wheels using numpy 2.0rc1 Co-authored-by: Thomas Li <[email protected]>
…s for 2.2.2) (#58206) Backport PR #58203: DOC: Add release date/contributors for 2.2.2 Co-authored-by: Thomas Li <[email protected]>
Thanks for the PR, but please contain the changes to one open pull request at a time |
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.
Problem
Fixes issue #61841 — calling
.rolling().mean()
twice on a copied DataFrame was returning all NaNs on the second run.This happened due to a slicing operation (
[::self.step]
) in_apply_columnwise
, which broke result alignment when overwriting the same column.Solution
Removed the
[:: self.step]
slicing from the return statement. This restores full alignment and fixes the regression.Test Case
Tested locally with this code: