Skip to content

Commit dafd24c

Browse files
committed
refactor
1 parent 5720684 commit dafd24c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pandas/core/frame.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11353,8 +11353,7 @@ def cov(
1135311353
c -0.150812 0.191417 0.895202
1135411354
"""
1135511355
data = self._get_numeric_data() if numeric_only else self
11356-
dtypes = [blk.dtype for blk in self._mgr.blocks]
11357-
if any(d.kind in "mM" for d in dtypes):
11356+
if any(blk.dtype.kind in "mM" for blk in self._mgr.blocks):
1135811357
msg = (
1135911358
"DataFrame contains columns with dtype datetime64 "
1136011359
"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
@@ -1867,7 +1867,7 @@ def _interleave(
18671867
else:
18681868
arr = blk.get_values(dtype)
18691869
result[rl.indexer] = arr
1870-
if na_value is not lib.no_default and blk.dtype.kind in ["m", "M"]:
1870+
if na_value is not lib.no_default and blk.dtype.kind in "mM":
18711871
result[rl.indexer][isna(arr)] = na_value
18721872
itemmask[rl.indexer] = 1
18731873

0 commit comments

Comments
 (0)