-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: changed behavior of df.loc on multiindex since 1.3.0 #43599
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
Hello, I am a first-time contributor. Is the issue still open? |
From the looks of it the two prior PRs were closed due to inactivity, and no one else has been assigned the issue, so I think you can go ahead and work on it. If you want the issue assigned to you try writing a single comment in here with the text "take" - this will make a bot assign the issue to you, letting other people know, that it is being worked on. If you haven't read it from one end to another I'd suggest reading the "Contributing to pandas"-section. As a newbie I think its supportive :-) |
take |
Closed by #46190 |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
Issue Description
for versions later than 1.3, this selection will keep the second level in the index. But for versions earlier than 1.3, the 2nd level will be dropped:
Expected Behavior
I've read the release notes of 1.3 but can't find a documentation about this. Is this a changed behavior?
Installed Versions
INSTALLED VERSIONS
commit : 7c48ff4
python : 3.8.10.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-156-generic
Version : #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.5
numpy : 1.20.3
pytz : 2021.1
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.0.4
Cython : 0.29.23
pytest : 6.2.4
hypothesis : None
sphinx : 4.1.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.2
html5lib : 1.1
pymysql : 0.9.3
psycopg2 : 2.8.6 (dt dec pq3 ext lo64)
jinja2 : 3.0.1
IPython : 7.27.0
pandas_datareader: 0.9.0
bs4 : 4.9.3
bottleneck : None
fsspec : 0.8.5
fastparquet : None
gcsfs : None
matplotlib : 3.3.3
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.5
pandas_gbq : None
pyarrow : 4.0.1
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : 1.4.17
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 2.0.1
xlwt : None
numba : 0.54.0
INSTALLED VERSIONS
commit : 73c6825
python : 3.8.10.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-156-generic
Version : #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.3
numpy : 1.20.3
pytz : 2021.1
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.0.4
Cython : 0.29.23
pytest : 6.2.4
hypothesis : None
sphinx : 4.1.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.2
html5lib : 1.1
pymysql : 0.9.3
psycopg2 : 2.8.6 (dt dec pq3 ext lo64)
jinja2 : 3.0.1
IPython : 7.27.0
pandas_datareader: 0.9.0
bs4 : 4.9.3
bottleneck : None
fsspec : 0.8.5
fastparquet : None
gcsfs : None
matplotlib : 3.3.3
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.5
pandas_gbq : None
pyarrow : 4.0.1
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : 1.4.17
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 2.0.1
xlwt : None
numba : 0.54.0
The text was updated successfully, but these errors were encountered: