Skip to content

BUG: pivot_table with multi-index columns only fails #31013

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 11 commits into from
Jan 15, 2020

Conversation

charlesdong1991
Copy link
Member

@charlesdong1991 charlesdong1991 commented Jan 14, 2020

Comment on lines -899 to -904
# no rows
rtable = self.data.pivot_table(
columns=["AA", "BB"], margins=True, aggfunc=np.mean
)
assert isinstance(rtable, Series)

Copy link
Member Author

Choose a reason for hiding this comment

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

this gives a wrong shape, should not return Series but a DataFrame with AA and BB for columns, I created an issue to address it!

@simonjayhawkins simonjayhawkins added Bug MultiIndex Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Jan 14, 2020
@jreback jreback added this to the 1.1 milestone Jan 15, 2020
@jreback jreback merged commit 586bcb1 into pandas-dev:master Jan 15, 2020
@jreback
Copy link
Contributor

jreback commented Jan 15, 2020

very nice @charlesdong1991

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug MultiIndex Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG/API: pivot_table with multi-index columns only
3 participants