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 e557039 commit bda0025Copy full SHA for bda0025
pandas/core/frame.py
@@ -11239,6 +11239,12 @@ def cov(
11239
c -0.150812 0.191417 0.895202
11240
"""
11241
data = self._get_numeric_data() if numeric_only else self
11242
+ if data.select_dtypes(include=[np.datetime64, np.timedelta64]).shape[1] > 0:
11243
+ msg = (
11244
+ "DataFrame contains columns with dtype datetime64[ns] "
11245
+ "or timedelta64[ns], which are not supported for cov."
11246
+ )
11247
+ raise TypeError(msg)
11248
cols = data.columns
11249
idx = cols.copy()
11250
mat = data.to_numpy(dtype=float, na_value=np.nan, copy=False)
0 commit comments