Skip to content

BUG: GH11517 add multiindex column names after describe() #11546

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

Merged
merged 1 commit into from
Nov 10, 2015

Conversation

varunkumar-dev
Copy link
Contributor

Hi,

This fixes the bug mentioned in #11517
I have added column names after the describe operation.
Request you to review the change and merge it.

Thanks

@hayd
Copy link
Contributor

hayd commented Nov 8, 2015

Please add a test for this :)

@varunkumar-dev
Copy link
Contributor Author

Hi,

I have added test case for that .
Request you to review the change .

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves labels Nov 8, 2015
@@ -1471,6 +1471,16 @@ def test_describe_typefiltering_groupby(self):
self.assertTrue(G.describe(include=['number', 'object']).shape == (22, 3))
self.assertTrue(G.describe(include='all').shape == (26, 4))

# GH 11517
def test_describe_multi_index_df_column_names(self):
df = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'foo'],
Copy link
Contributor

Choose a reason for hiding this comment

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

do the same tests, but just group on A (to simulate a non-hierarchical index).

@jreback jreback added this to the 0.17.1 milestone Nov 8, 2015
@jreback
Copy link
Contributor

jreback commented Nov 8, 2015

pls add a whatsnew note for 0.17.1

@varunkumar-dev
Copy link
Contributor Author

Thanks for comments.
I have modified test case and also added comment to whatsnew 0.17.1
Please review..

'B': ['one', 'one', 'two', 'three', 'two', 'two', 'one', 'three'],
'C': np.random.randn(8),
'D': np.random.randn(8)})
# test for hierarchical index
Copy link
Contributor

Choose a reason for hiding this comment

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

great ,use a blank line between different cases (e.g. before the comment).

move the isssue number inside the test, and provide a description of what this tests is doing

@jreback
Copy link
Contributor

jreback commented Nov 8, 2015

couple of comments. pls squash when done. ping on green.

@varunkumar-dev
Copy link
Contributor Author

I have made the changes.
Request you to please review and merge.

@jreback
Copy link
Contributor

jreback commented Nov 8, 2015

looks good. pls squash to a single commit. ping when green.

@varunkumar-dev
Copy link
Contributor Author

Done. Please check.

@jreback
Copy link
Contributor

jreback commented Nov 10, 2015

@varunkumar-dev varunkumar-dev force-pushed the fix-describe-column-names branch from 65600b4 to 1c66021 Compare November 10, 2015 01:16
@varunkumar-dev
Copy link
Contributor Author

Apologies for not getting it right the first time
Please check.

jreback added a commit that referenced this pull request Nov 10, 2015
BUG: GH11517 add multiindex column names after describe()
@jreback jreback merged commit ed98629 into pandas-dev:master Nov 10, 2015
@jreback
Copy link
Contributor

jreback commented Nov 10, 2015

thank you sir!

@varunkumar-dev varunkumar-dev deleted the fix-describe-column-names branch November 10, 2015 04:26
@dragoljub
Copy link

@varun-kr @jreback

Thanks for fixing this bug. 👍 I'll have to get on the bandwagon and submit some pull requests also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants