Skip to content

Empty DataFrame breaks .pivot_table() #712

Closed
@kieranholland

Description

@kieranholland

Example:

df = DataFrame({}, columns=['a', 'b'])
df.pivot_table(rows='a')

Activity

adamklein

adamklein commented on Jan 30, 2012

@adamklein
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

kieranholland commented on Jan 30, 2012

@kieranholland
Author

Confirmed - my mistake, thanks.

added a commit that references this issue on Sep 23, 2019

Fix issue pandas-dev#712 - pandas deprecation warning in chunkstore s…

9f32653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @adamklein@kieranholland

        Issue actions

          Empty DataFrame breaks .pivot_table() · Issue #712 · pandas-dev/pandas