-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: RollingGroupby respects __getitem__ #35513
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
Conversation
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.
Thanks @mroeschke lgtm pending green (have restarted the failing travis job, failure was unrelated)
doc/source/whatsnew/v1.1.1.rst
Outdated
@@ -44,6 +44,10 @@ Bug fixes | |||
|
|||
- | |||
|
|||
**Groupby/resample/rolling** | |||
|
|||
- Bug in :class:`pandas.core.groupby.RollingGroupby` where ``__getitem__`` would not select the specified column (:issue:`35486`) |
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.
maybe move to regression section above.
(this section is for bug fixes, we maybe should have a discussion in #35489 regarding the criteria for backporting bugfixes otherwise this section may end up empty)
doc/source/whatsnew/v1.1.1.rst
Outdated
@@ -15,7 +15,7 @@ including other versions of pandas. | |||
Fixed regressions | |||
~~~~~~~~~~~~~~~~~ | |||
|
|||
- | |||
- Bug in :class:`pandas.core.groupby.RollingGroupby` where ``__getitem__`` would not select the specified column (:issue:`35486`) |
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.
Minor nit but is there a way to make this more user-friendly? Fair to say something like Bug in ... where column selection was being ignored
?
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.
Sure, ya that phrasing would be more user friendly
df = DataFrame( | ||
{"a": [1, 2, 3, 2], "b": [4.0, 2.0, 3.0, 1.0], "c": [10, 20, 30, 20]} | ||
) | ||
result = df.groupby("a")[["b"]].rolling(2).max() |
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.
can you also test a df.groupby('a')['b']
as well
thanks for addressing @mroeschke |
@meeseeksdev backport to 1.1.x |
Co-authored-by: Matthew Roeschke <[email protected]>
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff