Skip to content

BUG: rolling.groupby with on and __getitem__ doesn't mutate underlying object - #43374

Merged
jreback merged 4 commits into
pandas-dev:masterfrom
mroeschke:bug/groupby_rolling_on_getitem_mutate
Sep 6, 2021
Merged

jreback merged 4 commits into
pandas-dev:masterfrom
mroeschke:bug/groupby_rolling_on_getitem_mutate

Conversation

@mroeschke

Copy link
Copy Markdown
Member

@mroeschke mroeschke added Groupby Window rolling, ewma, expanding labels Sep 3, 2021
@mroeschke mroeschke added this to the 1.4 milestone Sep 3, 2021
Comment thread doc/source/whatsnew/v1.4.0.rst Outdated
- Bug in :meth:`pandas.DataFrame.rolling` operation along rows (``axis=1``) incorrectly omits columns containing ``float16`` and ``float32`` (:issue:`41779`)
- Bug in :meth:`Resampler.aggregate` did not allow the use of Named Aggregation (:issue:`32803`)
- Bug in :meth:`Series.rolling` when the :class:`Series` ``dtype`` was ``Int64`` (:issue:`43016`)
- Bug in :meth:`DataFrame.groupby.rolling` when specifying ``on`` and calling ``__getitem__`` would return subsequent incorrect results (:issue:`43355`)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"return subsequent" -> "subsequently return"?

@simonjayhawkins

Copy link
Copy Markdown
Member

Thanks @mroeschke This does not close the issue? (as indicated in the OP)

There are still the issues of the inconsistent indexes between grp.count() and grp["y"].count() and the issue of the change in index from 1.2.5?

@mroeschke

Copy link
Copy Markdown
Member Author

Sorry, since #43355 reported 2 bugs, this just addresses one of them.

I just opened up #43405 separately since this PR does not address the index inconsistency.

@simonjayhawkins

Copy link
Copy Markdown
Member

I just opened up #43405 separately since this PR does not address the index inconsistency.

Thanks @mroeschke

There are still the issues of the inconsistent indexes between grp.count() and grp["y"].count() and the issue of the change in index from 1.2.5?

there was a typo here. the index didn't change from 1.2.5, the result columns did. There was a change in index from 1.1.5. I've commented on the issue. #43405 (comment)

@jreback
jreback merged commit 721f7bf into pandas-dev:master Sep 6, 2021
@jreback

jreback commented Sep 6, 2021

Copy link
Copy Markdown
Contributor

thanks @mroeschke

@mroeschke
mroeschke deleted the bug/groupby_rolling_on_getitem_mutate branch September 6, 2021 17:14
feefladder pushed a commit to feefladder/pandas that referenced this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Groupby Window rolling, ewma, expanding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Groupby rolling count gives inconsistent outputs with missing index

4 participants