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/lib/polynomial.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/polynomial.py') diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 281d79ec5..f00d95b6c 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -201,7 +201,7 @@ def roots(p): """ # If input is scalar, this makes it an array p = atleast_1d(p) - if len(p.shape) != 1: + if p.ndim != 1: raise ValueError("Input must be a rank-1 array.") # find non-zero array entries @@ -1051,7 +1051,7 @@ class poly1d(object): if r: c_or_r = poly(c_or_r) c_or_r = atleast_1d(c_or_r) - if len(c_or_r.shape) > 1: + if c_or_r.ndim > 1: raise ValueError("Polynomial must be 1d only.") c_or_r = trim_zeros(c_or_r, trim='f') if len(c_or_r) == 0: -- cgit v1.2.1