diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-10-05 15:59:21 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-10-05 15:59:21 -0600 |
commit | 9c8a7c98325439eb969df1799992953706a9ad59 (patch) | |
tree | 3f1042753058e4208f7bf8a90d1e22e4603f5c07 /numpy/lib/tests/test_function_base.py | |
parent | 09c958b0100860db9549a17b6d1684f3c9fb8885 (diff) | |
parent | 780c1053d7c938e251abe4abb7b81d2f7034ca04 (diff) | |
download | numpy-9c8a7c98325439eb969df1799992953706a9ad59.tar.gz |
Merge pull request #6414 from larsmans/corrcoef-stability
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 |