BUG: na_position
ignored when sorting MultiIndex
with level!=None
#51612
Labels
na_position
ignored when sorting MultiIndex
with level!=None
#51612
Pandas version checks
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 main branch of pandas.
Reproducible Example
Issue Description
Sorting should be consistent whether or not all levels in
level
kwarg are provided. It appears thatna_position
is ignored when providinglevel
.Expected Behavior
na_position="last"
should be the default behaviour no matter whetherlevel
is provided or notInstalled Versions
pandas : 2.1.0.dev0+47.gb69bd0755d
numpy : 1.23.5
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 65.6.3
pip : 23.0
Cython : None
pytest : 7.2.0
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.8.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : 2022.11.0
gcsfs : None
matplotlib : 3.6.2
numba : 0.56.4
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : 2022.11.0
scipy : 1.9.3
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : None
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: