-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Multiindex slicing with NaNs, unexpected results #25154
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
Labels
good first issue
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
MultiIndex
Needs Tests
Unit test(s) needed to prevent regressions
Milestone
Comments
cc @toobaz |
Definitely a bug. There might be a cleaner fix, but for the moment replacing the following line pandas/pandas/core/indexes/multi.py Line 2652 in 683c7b5
with
should do. |
This works now. May need some tests.
|
Hi, I'd like to try and work on adding some tests for this one. |
As long as no one is asigned you are free to go :) |
take |
theodorju
added a commit
to theodorju/pandas
that referenced
this issue
Jan 21, 2021
4 tasks
jreback
pushed a commit
that referenced
this issue
Feb 5, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
good first issue
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
MultiIndex
Needs Tests
Unit test(s) needed to prevent regressions
Code Sample, a copy-pastable example if possible
Problem description
When trying to slice out multiple values from a particular level including levels with a nan value, the levels with nan are not retrieved.
Expected Output
Both of these I expect to work:
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 2.7.15.final.0
python-bits: 64
OS: Linux
OS-release: 3.10.0-327.36.3.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.22.0
pytest: 3.10.0
pip: 18.1
setuptools: 40.5.0
Cython: 0.28.5
numpy: 1.14.2
scipy: 1.0.1
pyarrow: None
xarray: 0.10.9
IPython: 5.8.0
sphinx: 1.8.1
patsy: 0.5.1
dateutil: 2.7.2
pytz: 2018.7
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.7
feather: None
matplotlib: 2.2.3
openpyxl: 2.5.9
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.1.2
lxml: 4.2.1
bs4: 4.6.3
html5lib: 1.0.1
sqlalchemy: 1.2.11
pymysql: None
psycopg2: 2.7.5 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: