summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-02-27 20:39:12 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-02-27 20:39:58 +0100
commitdf84ecfea50ef33a1259c67c534a09238c0eefc8 (patch)
tree3c80f3fdde690886736a0b86d12d309873bc2cc1 /numpy/lib/tests/test_function_base.py
parent8c4d9bedd9d85d86c41f956cdb5140e112c2ac08 (diff)
downloadnumpy-df84ecfea50ef33a1259c67c534a09238c0eefc8.tar.gz
BUG: accept non arrays in cor and corrcoeff
closes gh-4295
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)