summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-02-27 14:31:35 -0700
committerCharles Harris <charlesr.harris@gmail.com>2014-02-27 14:31:35 -0700
commitf1aab14e17a7a92baad4857be6a3bb3c3106e0ec (patch)
treed40ebc004c3635bff89eedae813b76b50e41ecbd /numpy/lib/tests/test_function_base.py
parent0dbbbd48d79dd4b652e82e76c3b6e3815f254fc6 (diff)
parentdf84ecfea50ef33a1259c67c534a09238c0eefc8 (diff)
downloadnumpy-f1aab14e17a7a92baad4857be6a3bb3c3106e0ec.tar.gz
Merge pull request #4391 from juliantaylor/cov-array
BUG: accept non arrays in cor and corrcoeff
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 953292550..d6705072e 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1204,6 +1204,10 @@ class TestCorrCoef(TestCase):
[0.66318558, 0.88157256, 0.71483595, -0.51366032, 1., 0.98317823],
[0.51532523, 0.78052386, 0.83053601, -0.66173113, 0.98317823, 1.]])
+ def test_non_array(self):
+ assert_almost_equal(np.corrcoef([0, 1, 0], [1, 0, 1]),
+ [[1., -1.], [-1., 1.]])
+
def test_simple(self):
assert_almost_equal(corrcoef(self.A), self.res1)
assert_almost_equal(corrcoef(self.A, self.B), self.res2)