-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Open
Labels
BugDescribe/info/etcobj.describe, obj.info, requests for methods that look similarobj.describe, obj.info, requests for methods that look similarExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Needs DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
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
Series.describe sets the dtype for the results to Float64Dtype when the input is an EA. pint's Quantity
cannot be casted to Float64Dtype.
pandas/pandas/core/methods/describe.py
Line 255 in 35b0d1d
| 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
BugDescribe/info/etcobj.describe, obj.info, requests for methods that look similarobj.describe, obj.info, requests for methods that look similarExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Needs DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action