-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Rolling groupby should not maintain the by column in the resulting DataFrame #32332
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
Changes from 29 commits
a6ad6c5
54903a7
d81c572
e049205
5f43f3a
3b1c3ff
207a507
c9b34b2
b2ce758
c307fdc
35f2b2d
2bb7932
eed4122
26d9dec
68b4299
159a3d6
0b393b6
9fc50ee
7fe2fcf
8a34ff4
8953bda
b2b8a42
d476191
63e3d85
17373ad
a7ca8eb
35e7340
17090da
7c7f79c
9b98dad
4d1c5a6
0dde4a8
1e4ba56
6312725
d9748d1
1623902
5d7a477
d117624
367e671
d7cf9f1
d251715
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,13 @@ def __init__( | |
self.axis = obj._get_axis_number(axis) if axis is not None else None | ||
self.validate() | ||
self._numba_func_cache: Dict[Optional[str], Callable] = dict() | ||
self.exclusions = kwargs.get("exclusions", set()) | ||
|
||
def _shallow_copy(self, obj: FrameOrSeries, **kwargs) -> ShallowMixin: | ||
exclusions = self.exclusions | ||
new_obj = super()._shallow_copy(obj, exclusions=exclusions, **kwargs) | ||
new_obj.obj = new_obj._obj_with_exclusions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are you sure this line is actually needed? this is very very odd to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copying the exclusions should be enough. you maybe be able to move this shallow copy to pandas/core/groupby/groupby.py which is better than here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason for doing this was that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
As in, define
Here, EDITAnyway, am trying a slightly different approach, will ping if/when green and once I've thought over why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jreback thanks for your review. I've pushed a new attempt at a solution. I patches |
||
return new_obj | ||
|
||
@property | ||
def _constructor(self): | ||
|
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.
Add an expl here, a couple of sentences; this the issue number.