-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Attributes of DataFrameGroupBy when subset to a series #35443
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
Comments
I updated the OP to only include the two attributes that would cause a potential API change. |
After rethinking this, perhaps instead
should not raise, but rather be the same as |
@rhshadrach you've done a lot of work in this area since the OP. any chance this has been resolved? |
For
both lines |
Looks like test_subsetting_columns_keeps_attrs has an xfail for SeriesGroupBy with axis=1, not bc the attribute is failing to be inherited but bc the subsetting operation is raising when it tries to do |
I think this is expected behavior and shouldn't be an xfail. I'll move it to it's own test. |
xref #9959
When subsetting the columns of a dataframe after a groupby to a series:
the public-facing groupby arguments
axis
andas_index
are not passed on to the resultingSeriesGroupBy
.I think the following two examples should probably behave the same:
but the first produces
And the 2nd deliberately raises
TypeError: as_index=False only valid with DataFrame
.Note that the arguments
axis
andas_index
are only meant for DataFrames, and as such, I think a line such asshould raise.
The text was updated successfully, but these errors were encountered: