Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
s-banach opened this issue Aug 31, 2023 · 1 comment
Open
1 task done

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

s-banach opened this issue Aug 31, 2023 · 1 comment
Labels
Docs ExtensionArray Extending pandas with custom dtypes or arrays.

Comments

@s-banach
Copy link

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.

@s-banach s-banach added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 31, 2023
@phofl
Copy link
Member

phofl commented Aug 31, 2023

Yeah select dtypes doesn't work great for EA dtypes, thanks for reporting

@mroeschke mroeschke added ExtensionArray Extending pandas with custom dtypes or arrays. and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

No branches or pull requests

3 participants