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 a4fc97e commit ba656b6Copy full SHA for ba656b6
pandas/core/arrays/categorical.py
@@ -447,7 +447,10 @@ def __init__(
447
if isinstance(values.dtype, ArrowDtype) and issubclass(
448
values.dtype.type, CategoricalDtypeType
449
):
450
- arr = values._pa_array.combine_chunks()
+ if values.__class__.__name__ == 'Index':
451
+ arr = values._data._pa_array.combine_chunks()
452
+ else:
453
+ arr = values._pa_array.combine_chunks()
454
categories = arr.dictionary.to_pandas(types_mapper=ArrowDtype)
455
codes = arr.indices.to_numpy()
456
dtype = CategoricalDtype(categories, values.dtype.pyarrow_dtype.ordered)
0 commit comments