Skip to content

BUG: iloc getitem with DataFrame with MultiIndex #5528

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

Closed
zhangruoyu opened this issue Nov 16, 2013 · 1 comment · Fixed by #5529
Closed

BUG: iloc getitem with DataFrame with MultiIndex #5528

zhangruoyu opened this issue Nov 16, 2013 · 1 comment · Fixed by #5529
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@zhangruoyu
Copy link

import pandas as pd
import numpy as np

tup = zip(*[['a','a','b','b'],['x','y','x','y']])
index = pd.MultiIndex.from_tuples(tup)
df = pd.DataFrame(np.random.randn(4, 4), index=index)
df.iloc[[0, 1]]

This will raise:

ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long'

I am using 0.12 version.

@jreback
Copy link
Contributor

jreback commented Nov 16, 2013

thanks for the report

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants