Skip to content

Commit 851bd03

Browse files
committed
update dtype check
1 parent 75d1f32 commit 851bd03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11356,7 +11356,7 @@ def cov(
1135611356
"""
1135711357
data = self._get_numeric_data() if numeric_only else self
1135811358
dtypes = [blk.dtype for blk in self._mgr.blocks]
11359-
if any(is_datetime64_any_dtype(d) or is_timedelta64_dtype(d) for d in dtypes):
11359+
if any(d.kind in "mM" for d in dtypes):
1136011360
msg = (
1136111361
"DataFrame contains columns with dtype datetime64 "
1136211362
"or timedelta64, which are not supported for cov."

pandas/core/internals/managers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ def as_array(
18001800
arr = np.asarray(blk.values, dtype=dtype)
18011801
else:
18021802
arr = np.array(blk.values, dtype=dtype, copy=copy)
1803-
if passed_nan and blk.dtype.kind in ["m", "M"]:
1803+
if passed_nan and blk.dtype.kind in "mM":
18041804
arr[isna(blk.values)] = na_value
18051805

18061806
if not copy:

0 commit comments

Comments
 (0)