Skip to content

Empty DataFrame breaks .pivot_table() #712

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

Closed
kieranholland opened this issue Jan 30, 2012 · 2 comments
Closed

Empty DataFrame breaks .pivot_table() #712

kieranholland opened this issue Jan 30, 2012 · 2 comments
Milestone

Comments

@kieranholland
Copy link

Example:

df = DataFrame({}, columns=['a', 'b'])
df.pivot_table(rows='a')
@adamklein
Copy link
Contributor

This seems to work in the head revision of pandas. Can you confirm your version? Thanks!

In [1]: paste                                                                                                                       
df = DataFrame({}, columns=['a', 'b'])                                                                                              
df.pivot_table(rows='a')                                                                                                            
## -- End pasted text --                                                                                                            
Out[1]:                                                                                                                             
Empty DataFrame                                                                                                                     
Columns: array([b], dtype=object)                                                                                                   
Index: array([], dtype=object)                                                                                                      

@kieranholland
Copy link
Author

Confirmed - my mistake, thanks.

dan-nadler pushed a commit to dan-nadler/pandas that referenced this issue Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants