BUG: Joining dataframe with single-level MultiIndex fails #41537
Labels
Duplicate Report
Duplicate issue or pull request
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
I have checked that this issue has not already been reported.
There is BUG/API: index.array for RangeIndex, MultiIndex #37277 which is about the same error message but which isn't about the fact that this shows up in a common operation like joining. Maybe there is a way to make the join work without fixing the underlying issue?
I have confirmed this bug exists on the latest version of pandas.
Unfortunately my work doesn't allow me to test this on latest pandas versions, but given the related issue above and given that I haven't found this issue reported anywhere, I would be surprised if this was fixed in the meantime. I apologize if it was.
Code Sample, a copy-pastable example
Problem description
Throws an error
Expected Output
Throws no error. Uncomment the commented line above and comment the line below. This should be functionally equivalent.
PS: This probably doesn't belong here, but if I replace the
join
by amerge
it works, but thelevel1
of the MultiIndex disappears, making it useless for me.Output of
pd.show_versions()
INSTALLED VERSIONS
commit : b5958ee
python : 3.6.6.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.17134
machine : AMD64
processor : Intel64 Family 6 Model 85 Stepping 4, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : None.None
pandas : 1.1.5
numpy : 1.17.4
The text was updated successfully, but these errors were encountered: