Skip to content

Commit

Permalink
TST: new np.corrcoef improved stability
Browse files Browse the repository at this point in the history
  • Loading branch information
larsmans committed Oct 5, 2015
1 parent 09c958b commit 780c105
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions numpy/lib/tests/test_function_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,12 @@ def test_empty(self):
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
Expand Down

0 comments on commit 780c105

Please sign in to comment.