File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 105105 is_sequence ,
106106 needs_i8_conversion ,
107107 pandas_dtype ,
108+ is_timedelta64_dtype ,
109+ is_datetime64_any_dtype ,
108110)
109111from pandas .core .dtypes .concat import concat_compat
110112from pandas .core .dtypes .dtypes import (
@@ -11267,10 +11269,11 @@ def cov(
1126711269 c -0.150812 0.191417 0.895202
1126811270 """
1126911271 data = self ._get_numeric_data () if numeric_only else self
11270- if data .select_dtypes (include = [np .datetime64 , np .timedelta64 ]).shape [1 ] > 0 :
11272+ dtypes = [blk .dtype for blk in self ._mgr .blocks ]
11273+ if any (is_datetime64_any_dtype (d ) or is_timedelta64_dtype (d ) for d in dtypes ):
1127111274 msg = (
11272- "DataFrame contains columns with dtype datetime64[ns] "
11273- "or timedelta64[ns] , which are not supported for cov."
11275+ "DataFrame contains columns with dtype datetime64 "
11276+ "or timedelta64, which are not supported for cov."
1127411277 )
1127511278 raise TypeError (msg )
1127611279 cols = data .columns
You can’t perform that action at this time.
0 commit comments