Skip to content
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

TST: Add tests for groupby categorical values with axis=1 #27788

Merged
merged 8 commits into from
Aug 7, 2019

Conversation

charlesdong1991
Copy link
Member

@charlesdong1991 charlesdong1991 commented Aug 6, 2019

This is xref #27700 (comment)

@charlesdong1991 charlesdong1991 changed the title Add tests for groupby categorical values with axis=1 TST: Add tests for groupby categorical values with axis=1 Aug 6, 2019
@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Categorical Categorical Data Type labels Aug 6, 2019
def test_groupby_categorical_axis_1(code):
# GH 13420
df = DataFrame({"a": [1, 2, 3, 4], "b": [-1, -2, -3, -4], "c": [5, 6, 7, 8]})
grp = pd.Categorical.from_codes(code, categories=list("abc"))
Copy link
Member

Choose a reason for hiding this comment

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

Can you call this cat instead of grp? The latter is typically the result of an actual groupby

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, changed! @WillAyd and thanks for taking a look!

@WillAyd WillAyd added this to the 1.0 milestone Aug 7, 2019
@WillAyd WillAyd added the Groupby label Aug 7, 2019
@jreback
Copy link
Contributor

jreback commented Aug 7, 2019

lgtm. @WillAyd

@WillAyd WillAyd merged commit 3bdac3e into pandas-dev:master Aug 7, 2019
@WillAyd
Copy link
Member

WillAyd commented Aug 7, 2019

Thanks @charlesdong1991 !

quintusdias pushed a commit to quintusdias/pandas_dev that referenced this pull request Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Groupby Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame.groupby(grp, axis=1) with categorical grp breaks
4 participants