Skip to content

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