Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix mypy
  • Loading branch information
phofl committed Sep 26, 2022
commit f04e7f749f932c51a01bc977cd689ee5ee86b254
4 changes: 3 additions & 1 deletion pandas/core/describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

from pandas._libs.tslibs import Timestamp
from pandas._typing import (
DtypeObj,
NDFrameT,
npt,
)
Expand Down Expand Up @@ -244,10 +245,11 @@ def describe_numeric_1d(series: Series, percentiles: Sequence[float]) -> Series:
+ [series.max()]
)
# GH#48340 - always return float on non-complex numeric data
dtype: DtypeObj | None
if is_extension_array_dtype(series):
dtype = pd.Float64Dtype()
elif is_numeric_dtype(series) and not is_complex_dtype(series):
dtype = float
dtype = np.dtype("float")
else:
dtype = None
return Series(d, index=stat_index, name=series.name, dtype=dtype)
Expand Down