You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think in .cov we do a self.to_numpy(dtype=np.float64).
a) i think that should raise on a dt64 column
b) the NaT gets converted to -9.22337204e+18 where it should be np.nan
.cov definitely shouldn't work with a dt64 column (as df["b"].var() correctly raises); .corr should be OK
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
If I understand this correctly, both calculations should be equivalent. The np.nan case returns
while the NaT case returns
Both are equivalent without any missing values
Expected Behavior
Same result for both
Installed Versions
main
The text was updated successfully, but these errors were encountered: