BUG: Merge with EA and MultiIndex #43734
Labels
Bug
ExtensionArray
Extending pandas with custom dtypes or arrays.
MultiIndex
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Milestone
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
I am trying to make a merge between two data frames with a
MultiIndex
for the columns. The first data frame has an object data type (str
in my example) and the second an extension array data type (pd.StringDtype()
in my example). In this case, in an internal method, anassign
method is used but unfortunately, thename
of the column is not a string but a tuple...Expected Behavior
I would have expected the merge to happen as it is with two
str
dtype data frames or twopd.StirngDtype()
dtype data frames.Installed Versions
INSTALLED VERSIONS
commit : 73c6825
python : 3.9.6.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.0-8-amd64
Version : #1 SMP Debian 5.10.46-4 (2021-08-03)
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : fr_FR.UTF-8
LOCALE : fr_FR.UTF-8
pandas : 1.3.3
numpy : 1.21.2
pytz : 2021.1
dateutil : 2.8.2
pip : 21.2.4
setuptools : 57.4.0
Cython : 0.29.24
pytest : 6.2.5
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.1
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.1
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.4.3
numexpr : None
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : 1.4.25
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: