Skip to content

Commit dece94e

Browse files
committed
BUG: fix numpy deprecation warning for scalar datetime64 values
1 parent c44581f commit dece94e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/source/whatsnew/v0.23.5.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Fixed Regressions
2626
- Calling :meth:`DataFrameGroupBy.rank` and :meth:`SeriesGroupBy.rank` with empty groups
2727
and ``pct=True`` was raising a ``ZeroDivisionError`` due to `c1068d9
2828
<https://github.com/pandas-dev/pandas/commit/c1068d9d242c22cb2199156f6fb82eb5759178ae>`_ (:issue:`22519`)
29-
-
29+
- Constructing a Series with a numpy.datetime64 value will no longer issue a DeprecationWarning (:issue:`22741`)
3030
-
3131

3232

pandas/core/dtypes/cast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ def maybe_cast_to_datetime(value, dtype, errors='raise'):
10421042
"dtype [{dtype}]".format(dtype=dtype))
10431043

10441044
if is_scalar(value):
1045-
if value == iNaT or isna(value):
1045+
if np.asscalar(value) == iNaT or isna(value):
10461046
value = iNaT
10471047
else:
10481048
value = np.array(value, copy=False)

0 commit comments

Comments
 (0)