Skip to content

Commit 23eb852

Browse files
committed
Added test for covariance
1 parent 7c93140 commit 23eb852

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/frame/methods/test_cov_corr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,3 +497,9 @@ def test_corr_within_bounds(self):
497497
corr_matrix = df2.corr()
498498
assert corr_matrix.min().min() >= -1.0
499499
assert corr_matrix.max().max() <= 1.0
500+
501+
def test_cov_with_missing_values(self):
502+
df = DataFrame({"A": [1, 2, None, 4], "B": [2, 4, None, 9]})
503+
val1 = df.cov()
504+
val2 = df.dropna().cov()
505+
tm.assert_frame_equal(val1, val2)

0 commit comments

Comments
 (0)