Skip to content
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

DataFrame.drop loses MultiIndex #1513

Closed
scouredimage opened this issue Jun 22, 2012 · 2 comments
Closed

DataFrame.drop loses MultiIndex #1513

scouredimage opened this issue Jun 22, 2012 · 2 comments
Labels
Milestone

Comments

@scouredimage
Copy link

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

@wesm
Copy link
Member

wesm commented Jun 22, 2012

Thanks-- I'll take a look

@wesm wesm closed this as completed in 836ecab Jun 22, 2012
@wesm
Copy link
Member

wesm commented Jun 22, 2012

The MultiIndex was still there but the names are not preserved. Fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants