You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When left and right indexes have a different number of levels, the current behavior is to order the output as:
common levels + left levels not in right levels + right levels not in left levels
I agree this behavior seems odd. I would expect a left join to maintain the order of the left index levels. However, changing the behavior would break a few tests.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
output
Problem description
When two multindexed DataFrames are joined on a subset of the left index the resulting index becomes reordered.
Expected Output
I expect the order of the left dataframe to be kept after the left join.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.5.final.0
python-bits : 64
OS : Linux
OS-release : 5.3.0-51-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.3
numpy : 1.16.2
pytz : 2019.2
dateutil : 2.7.3
pip : 18.1
setuptools : 41.1.0
Cython : None
pytest : 3.7.4
hypothesis : None
sphinx : 2.4.4
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.5.0
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.10.2
pandas_datareader: None
bs4 : 4.9.0
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.5.0
matplotlib : 3.1.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pytest : 3.7.4
pyxlsb : None
s3fs : None
scipy : 1.1.0
sqlalchemy : None
tables : None
tabulate : None
xarray : 0.14.1
xlrd : None
xlwt : None
xlsxwriter : None
numba : None
The text was updated successfully, but these errors were encountered: