Skip to content

DOC: DataFrame.select_dtypes for non-object string types #54898

Open
@s-banach

Description

@s-banach

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.select_dtypes.html

Documentation problem

I want to select pyarrow string columns.
The documentation says to ask for object dtypes, which will not capture pyarrow strings.

Actually, it may be a bug rather than a documentation problem.
If I try something like this:

import pyarrow as pa
df.select_dtypes(include=[pd.ArrowDtype(pa.string()), pd.ArrowDtype(pa.large_string())])

Then I get the following error:
TypeError("string dtypes are not allowed, use 'object' instead")

Suggested fix for documentation

Just put this on the list of things that have to be done before pandas 3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsExtensionArrayExtending pandas with custom dtypes or arrays.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions