Skip to content

multiindex xs slicing bug fix #3378

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

Merged
merged 1 commit into from
Apr 17, 2013
Merged

multiindex xs slicing bug fix #3378

merged 1 commit into from
Apr 17, 2013

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Apr 17, 2013

#2903 solves the case for the first level but using the same variables from that issue, the following code raises a TypeError for the second level:

import pandas as pd
from numpy.random import rand
columns = pd.MultiIndex.from_tuples([('a', 'foo'), ('a', 'bar'), ('b', 'hello'), ('b', 'world')], names=['lvl0', 'lvl1'])
df = pd.DataFrame(rand(4, 4), columns=columns)
df.xs('foo', level='lvl1', axis=1)

This pull request fixes that.

@jreback
Copy link
Contributor

jreback commented Apr 17, 2013

looks ok to me

@ghost
Copy link

ghost commented Apr 17, 2013

Added a vbench for xs, looks fine.

jreback added a commit that referenced this pull request Apr 17, 2013
multiindex xs slicing bug fix - thanks!
@jreback jreback merged commit 57327e2 into pandas-dev:master Apr 17, 2013
@cpcloud cpcloud deleted the multiindex-bug branch April 17, 2013 22:45
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

Successfully merging this pull request may close these issues.

2 participants