Skip to content

DataFrame.drop loses MultiIndex #1513

Closed
@scouredimage

Description

@scouredimage
In [2]: df = DataFrame({'a': [1,2,3], 'b': [1,2,3], 'c': [4,5,6]})

In [3]: df.set_index(['a','b'], inplace=True)
Out[3]: 
     c
a b   
1 1  4
2 2  5
3 3  6

In [5]: dropped = df.drop((1,1))

In [6]: dropped
Out[6]: 
     c
2 2  5
3 3  6

MultiIndex is gone! (2,2) and (3,3) are now plain tuples

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions