Skip to content

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

Open
@andrewgsavage

Description

@andrewgsavage

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd, pint_pandas
s = pd.Series([1, 2, 3], dtype='pint[kg]')
s.describe()

DimensionalityError                       Traceback (most recent call last)
...

Issue Description

hgrecco/pint-pandas#279

Series.describe sets the dtype for the results to Float64Dtype when the input is an EA. pint's Quantity
cannot be casted to Float64Dtype.

dtype = Float64Dtype()

Expected Behavior

.describe should return a Series of objectdtype, or the dtype of the EA

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

Labels

BugExtensionArrayExtending pandas with custom dtypes or arrays.Needs DiscussionRequires discussion from core team before further action

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions