MCPcopy Create free account
hub / github.com/numpy/numpy / test_bias

Method test_bias

numpy/ma/tests/test_extras.py:1323–1334  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1321 assert_almost_equal(corrcoef(x, y, ddof=3), expected2)
1322
1323 def test_bias(self):
1324 x, y = self.data, self.data2
1325 expected = np.corrcoef(x)
1326 # bias raises DeprecationWarning
1327 with suppress_warnings() as sup:
1328 warnings.simplefilter("always")
1329 assert_warns(DeprecationWarning, corrcoef, x, y, True, False)
1330 assert_warns(DeprecationWarning, corrcoef, x, y, True, True)
1331 assert_warns(DeprecationWarning, corrcoef, x, bias=False)
1332 sup.filter(DeprecationWarning, "bias and ddof have no effect")
1333 # bias has no or negligible effect on the function
1334 assert_almost_equal(corrcoef(x, bias=1), expected)
1335
1336 def test_1d_without_missing(self):
1337 # Test cov on 1D variable w/o missing values

Callers

nothing calls this directly

Calls 5

suppress_warningsClass · 0.90
assert_warnsFunction · 0.90
assert_almost_equalFunction · 0.90
corrcoefFunction · 0.90
filterMethod · 0.80

Tested by

no test coverage detected