We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 437a322 commit 4d6e5e7Copy full SHA for 4d6e5e7
pandas/core/dtypes/concat.py
@@ -69,6 +69,11 @@ def concat_compat(
69
-------
70
a single array, preserving the combined dtypes
71
"""
72
+ # Special handling for categorical arrays solves #51362
73
+ if (len(to_concat) and
74
+ all(isinstance(arr.dtype, CategoricalDtype) for arr in to_concat) and
75
+ axis == 0):
76
+ return union_categoricals(to_concat)
77
if len(to_concat) and lib.dtypes_all_equal([obj.dtype for obj in to_concat]):
78
# fastpath!
79
obj = to_concat[0]
0 commit comments