From 48783e5ceb7f60c33db81ab72e5024f42b220990 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Fri, 24 Feb 2017 16:46:58 +0000 Subject: MAINT: replace len(x.shape) with x.ndim --- numpy/linalg/tests/test_linalg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/linalg/tests') diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py index fc4f98ed7..31fde186f 100644 --- a/numpy/linalg/tests/test_linalg.py +++ b/numpy/linalg/tests/test_linalg.py @@ -743,7 +743,7 @@ class TestLstsq(LinalgSquareTestCase, LinalgNonsquareTestCase): expect_resids = ( np.asarray(abs(np.dot(a, x) - b)) ** 2).sum(axis=0) expect_resids = np.asarray(expect_resids) - if len(np.asarray(b).shape) == 1: + if np.asarray(b).ndim == 1: expect_resids.shape = (1,) assert_equal(residuals.shape, expect_resids.shape) else: -- cgit v1.2.1