Skip to content

[C++][Python] Support for pandas Categoricals with Intervals #30119

Description

@asfimport

Trying to write a pandas categorical created from pd.cut fails with the following error:

df_test=pd.DataFrame({"cat": pd.cut([1, 2, 3, 4, 5], bins=[2, 4])})
df_test.to_parquet("test.parquet")
File"pyarrow/error.pxi", line120, inpyarrow.lib.check_statuspyarrow.lib.ArrowNotImplementedError: Unsupportedcastfromdictionary<values=extension<pandas.interval<ArrowIntervalType>>, indices=int8, ordered=1>toextension<pandas.interval<ArrowIntervalType>> (noavailablecastfunctionfortargettype)

The problems seems to be the interval dtype. Specifing the labels keyword solved the problem.

Reporter: Alberto Torres

Related issues:

Note: This issue was originally created as ARROW-14569. Please see the migration documentation for further details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions