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

Allowing empty slice in multi-indices #8781

Merged
merged 1 commit into from Nov 11, 2014

Conversation

SylvainCorlay
Copy link
Contributor

This solves #8737 in the case where there is at least one boolean indexer. The patch of #8739 does not allow the following:

import pandas as pd
import numpy as np
multi_index = pd.MultiIndex.from_product((['foo', 'bar', 'baz'], ['alpha', 'beta']))
df = pd.DataFrame(np.random.randn(5, 6), index=range(5), columns=multi_index)
df = df.sortlevel(0, axis=1)
df.loc[:, (['foo'], [])]

@SylvainCorlay
Copy link
Contributor Author

The Travis failure seems unrelated to this change.

@jreback
Copy link
Contributor

jreback commented Nov 10, 2014

pls add your example as a test (and put it after the 8737 test)

@SylvainCorlay
Copy link
Contributor Author

Done.

@jreback
Copy link
Contributor

jreback commented Nov 10, 2014

don't worry about that failing test - sep issue

also pls add a release note in v0.15.2 (u can ref this issue)

@SylvainCorlay
Copy link
Contributor Author

here it is

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex labels Nov 11, 2014
@jreback jreback added this to the 0.15.2 milestone Nov 11, 2014
@jreback
Copy link
Contributor

jreback commented Nov 11, 2014

can you sqush the commits? thanks.

@SylvainCorlay
Copy link
Contributor Author

Rebased.

jreback added a commit that referenced this pull request Nov 11, 2014
Allowing empty slice in multi-indices
@jreback jreback merged commit 81c8a5f into pandas-dev:master Nov 11, 2014
@jreback
Copy link
Contributor

jreback commented Nov 11, 2014

thank you for the fix!

@SylvainCorlay SylvainCorlay deleted the empty_slice branch November 11, 2014 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants