Skip to content

BUG: .describe() doesn't work for EAs #61707 #61910

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kernelism
Copy link

This PR fixes a bug where Series.describe() fails on certain ExtensionArray dtypes such as pint[kg], due to attempting to cast the result to Float64Dtype. This is because some of the produced statistics are not castable to float, which raises errors like DimensionalityError.

We now avoid forcing a Float64Dtype return dtype when the EA’s scalar values cannot be safely cast. Instead:

If the EA produces outputs with mixed dtypes, the result is returned with dtype=None.

@jbrockmendel This is a new PR with the comments from 61760 addressed. Apologies for the duplication.

@jbrockmendel
Copy link
Member

Looks like this breaks some other tests

@simonjayhawkins simonjayhawkins added Bug ExtensionArray Extending pandas with custom dtypes or arrays. labels Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: .describe() doesn't work for EAs
3 participants