summaryrefslogtreecommitdiff
path: root/numpy/lib/polynomial.py
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@gmail.com>2017-02-25 16:39:43 +0100
committerGitHub <noreply@github.com>2017-02-25 16:39:43 +0100
commiteb271d95c0c9f3821009330d858a261b4b861bfe (patch)
tree4e076b45c91eacce30cdbdc0f3b80cad1118dcdd /numpy/lib/polynomial.py
parente9246860480b6c909e6e00c1cd4371b0e5fee1ce (diff)
parent38ce8097749ad69494926036250ed5b2de66184c (diff)
downloadnumpy-eb271d95c0c9f3821009330d858a261b4b861bfe.tar.gz
Merge pull request #8685 from eric-wieser/shape-to-ndim
ENH: add dtype.ndim
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r--numpy/lib/polynomial.py4
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: