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
I'm trying to merge to dataframes. Both have a multiindex and an "id" column. The merge happens on "id", the outer layer of the multiindex should receive suffixes. Depending on the number of indices in the multiindex this doesn't work. Only some of the multiindex columns receive suffixes, other's don't. For the codesample, I've set up an empty dataframe, the behaviour is the same when it is filled with data.
The issue seems non-deterministic. Sometimes it happens, sometimes it doesn't. Here is a video: https://imgur.com/a/rbSvuSl
* test_lexsort_depth verify that lexsort_depth return the correct depth
when sortorder is passed to the MultiIndex constructor
* test_raise_invalid_sortorder test that the MultiIndex constructor
raise when passing an incorrect sortorder
* test_merge_multiindex_columns test the original issue
nrebena
added a commit
to nrebena/pandas
that referenced
this issue
Oct 1, 2019
This fix issue pandas-dev#28518, where the label of the merge index where invalid
due to inconsistent lexsort_depth property of the intersection of the
indexes
Code Sample, a copy-pastable example if possible
Problem description
I'm trying to merge to dataframes. Both have a multiindex and an "id" column. The merge happens on "id", the outer layer of the multiindex should receive suffixes. Depending on the number of indices in the multiindex this doesn't work. Only some of the multiindex columns receive suffixes, other's don't. For the codesample, I've set up an empty dataframe, the behaviour is the same when it is filled with data.
The issue seems non-deterministic. Sometimes it happens, sometimes it doesn't. Here is a video:
https://imgur.com/a/rbSvuSl
I'm using pandas version 0.25.1
This is a conda environment, here is its yml file: https://gist.github.com/lhk/ab3cf1f95be37a23789792fd75beef93
Expected Output
All columns in the multiindex should receive either _x or _y as suffix.
Output of
pd.show_versions()
pandas : 0.25.1
numpy : 1.16.5
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.2
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.8.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.1
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: