def test_bias(self):
x, y = self.data, self.data2
expected = np.corrcoef(x)
# bias raises DeprecationWarning
with catch_warn_mae():
warnings.simplefilter("always")
assert_warns(DeprecationWarning, corrcoef, x, y, True, False)
assert_warns(DeprecationWarning, corrcoef, x, y, True, True)
assert_warns(DeprecationWarning, corrcoef, x, bias=False)
warnings.simplefilter("ignore")
# bias has no or negligible effect on the function
assert_almost_equal(corrcoef(x, bias=1), expected)
评论列表
文章目录