-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Indexing MultiIndex with NDFrame indexer fails if index of indexer does not contain 0 #15424
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
Comments
ok this looks like a bug. IIRC we had a similar issue (maybe was yours)? |
There was #14730 (this bug might actually be a side effect of its fix, but I didn't check). |
@toobaz ok, can you add those examples as confirmation tests (they look similar). if they pass, then add that issue as well in the whatsnew note. |
I'm lost... have you seen the PR? (#15425) |
of course that is where they should be added |
OK, I asked because that issue is already in the whatsnew note So: you suggest I add to the tests I already wrote the ones in this bug report, right? (except for the data content, they are exactly the same...) |
ahh ok then |
…xers closes pandas-dev#15424 closes pandas-dev#15434 Author: Pietro Battiston <[email protected]> Closes pandas-dev#15425 from toobaz/mi_indexing and squashes the following commits: 2ba2d5d [Pietro Battiston] Updated comment 900e3ce [Pietro Battiston] whatsnew 8467b57 [Pietro Battiston] Tests for previous commit 17209f3 [Pietro Battiston] BUG: support indexing MultiIndex with 1-D array 7606114 [Pietro Battiston] Whatsnew 0b719f5 [Pietro Battiston] Test for previous commit 1f2f385 [Pietro Battiston] BUG: Fix indexing MultiIndex with Series with 0 not index
Code Sample, a copy-pastable example if possible
Problem description
The index of the indexer should not matter at all... and indeed there is no bug when indexing a (non-
Multi
)Index
:Expected Output
The same as
d.set_index(['a', 'b']).loc[pd.Series([1, 2])]
.A PR is on its way.
Output of
pd.show_versions()
pandas: 0.19.0+464.g0b28e5a
pytest: None
pip: 8.1.2
setuptools: 28.0.0
Cython: 0.23.4
numpy: 1.12.0
scipy: 0.18.1
xarray: None
IPython: 5.1.0.dev
sphinx: 1.4.8
patsy: 0.3.0-dev
dateutil: 2.5.3
pytz: 2015.7
blosc: None
bottleneck: 1.2.0
tables: 3.2.2
numexpr: 2.6.0
feather: None
matplotlib: 2.0.0rc2
openpyxl: None
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.3
lxml: None
bs4: 4.5.1
html5lib: 0.999
httplib2: 0.9.1
apiclient: 1.5.2
sqlalchemy: 1.0.15
pymysql: None
psycopg2: None
jinja2: 2.8
s3fs: None
pandas_datareader: 0.2.1
The text was updated successfully, but these errors were encountered: