diff options
author | Lars Buitinck <larsmans@gmail.com> | 2015-10-03 14:18:51 +0200 |
---|---|---|
committer | Lars Buitinck <larsmans@gmail.com> | 2015-10-05 23:39:09 +0200 |
commit | 780c1053d7c938e251abe4abb7b81d2f7034ca04 (patch) | |
tree | 3f1042753058e4208f7bf8a90d1e22e4603f5c07 /numpy/lib/tests/test_function_base.py | |
parent | 09c958b0100860db9549a17b6d1684f3c9fb8885 (diff) | |
download | numpy-780c1053d7c938e251abe4abb7b81d2f7034ca04.tar.gz |
TST: new np.corrcoef improved stability
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 5e758fb89..4516c9248 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -1597,6 +1597,12 @@ class TestCorrCoef(TestCase): assert_array_equal(corrcoef(np.array([]).reshape(2, 0)), np.array([[np.nan, np.nan], [np.nan, np.nan]])) + def test_extreme(self): + x = [[1e-100, 1e100], [1e100, 1e-100]] + with np.errstate(all='raise'): + c = corrcoef(x) + assert_array_almost_equal(c, np.array([[1., -1.], [-1., 1.]])) + class TestCov(TestCase): x1 = np.array([[0, 2], [1, 1], [2, 0]]).T |