We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cb5cf9 commit 586e2c7Copy full SHA for 586e2c7
pandas/core/dtypes/cast.py
@@ -23,7 +23,6 @@
23
from pandas._libs.tslibs import (
24
NaT,
25
OutOfBoundsDatetime,
26
- Period,
27
Timedelta,
28
Timestamp,
29
conversion,
@@ -63,6 +62,7 @@
63
62
is_integer_dtype,
64
is_numeric_dtype,
65
is_object_dtype,
+ is_period_dtype,
66
is_scalar,
67
is_sparse,
68
is_string_dtype,
@@ -188,7 +188,7 @@ def maybe_downcast_to_dtype(result, dtype: Dtype):
188
else:
189
result = result.astype(dtype)
190
191
- elif dtype.type is Period:
+ elif is_period_dtype(dtype):
192
# TODO(DatetimeArray): merge with previous elif
193
from pandas.core.arrays import PeriodArray
194
0 commit comments