diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-05 07:48:48 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-05 07:48:48 +0000 |
commit | 3457ac34f84f502de194ad825c0db4cb0d56dc82 (patch) | |
tree | 3b76d6ccfb0d3cbeddff00e7c7d359d5fa541d1e /numpy/lib/polynomial.py | |
parent | 0820b2a2c8cebe828c1a9faa1bef45a8b0421100 (diff) | |
download | numpy-3457ac34f84f502de194ad825c0db4cb0d56dc82.tar.gz |
Fix uses of nonzero and add flatnonzero
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r-- | numpy/lib/polynomial.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 206558179..0d66fd6b0 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -90,7 +90,7 @@ def roots(p): raise ValueError,"Input must be a rank-1 array." # find non-zero array entries - non_zero = NX.nonzero(NX.ravel(p)) + non_zero = NX.nonzero(NX.ravel(p))[0] # find the number of trailing zeros -- this is the number of roots at 0. trailing_zeros = len(p) - non_zero[-1] - 1 |