Inconsistent behavior when calling join/concat on DataFrames with CategoricalIndex and IntervalIndex #25019
Labels
Bug
Categorical
Categorical Data Type
Interval
Interval data type
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Code Sample
Problem description
When joining dataframes with
CategoricalIndex
andIntervalIndex
, sometimes it does not work. In particular, when thedf
on which we calljoin
hasIntervalIndex
, and the argument is adf
withCategoricalIndex
and is wrapped in a list, somewhere inconcat.py
throws aTypeError
with an undecipherable error message.pd.concat
on these DataFrames throws a slightly more helpful message.Expected Output
I'm not exactly sure what the current rule is regarding how to handle these two index types, but we should make it consistent. I think if the index'es can be matched (possibly after conversion), then the join/concat operation should be allowed. Or maybe give a warning saying some conversion is done implicitly.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-138-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.0
pytest: None
pip: 19.0.1
setuptools: 39.1.0
Cython: None
numpy: 1.16.0
scipy: 1.2.0
pyarrow: None
xarray: None
IPython: 7.1.1
sphinx: None
patsy: None
dateutil: 2.7.2
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.2
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml.etree: 4.2.4
bs4: None
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: