diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-02-24 16:46:58 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-02-24 16:46:58 +0000 |
commit | 48783e5ceb7f60c33db81ab72e5024f42b220990 (patch) | |
tree | 2284b780e521418b0e73fd7283403d3e7e28da50 /numpy/lib/polynomial.py | |
parent | 5f5ccecbfc116284ed8c8d53cd8b203ceef5f7c7 (diff) | |
download | numpy-48783e5ceb7f60c33db81ab72e5024f42b220990.tar.gz |
MAINT: replace len(x.shape) with x.ndim
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r-- | numpy/lib/polynomial.py | 4 |
1 files changed, 2 insertions, 2 deletions
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: |