BUG: Concatenation of two objects of the category
type gives an object of the object
type
#43477
Closed
2 of 3 tasks
Labels
Categorical
Categorical Data Type
Duplicate Report
Duplicate issue or pull request
Needs Triage
Issue that has not been reviewed by a pandas team member
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
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
The output of the codes above is:
category category object
Expected Behavior
I expect the output to be:
category category category
Concatenation of two objects of the same type should give an object of that type. The current behavior gave me some unexpected results that took me a while to figure out.
Installed Versions
INSTALLED VERSIONS
commit : 2cb9652
python : 3.7.10.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.120+
Version : #1 SMP Wed Aug 18 10:20:32 PDT 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : C.UTF-8
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.4
numpy : 1.19.5
pytz : 2021.1
dateutil : 2.8.1
pip : 21.1.2
setuptools : 49.6.0.post20210108
Cython : 0.29.23
pytest : 6.2.4
hypothesis : 6.14.1
sphinx : None
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.6.3
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.0.1
IPython : 7.24.1
pandas_datareader: 0.9.0
bs4 : 4.9.3
bottleneck : 1.3.2
fsspec : 2021.06.1
fastparquet : None
gcsfs : 2021.06.0
matplotlib : 3.4.2
numexpr : 2.7.3
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 4.0.0
pyxlsb : None
s3fs : 2021.06.1
scipy : 1.6.3
sqlalchemy : 1.4.18
tables : 3.6.1
tabulate : 0.8.9
xarray : 0.18.2
xlrd : None
xlwt : None
numba : 0.53.1
The text was updated successfully, but these errors were encountered: