summaryrefslogtreecommitdiff
path: root/numpy/lib/polynomial.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r--numpy/lib/polynomial.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index 8545375cd..10ae32a60 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -127,7 +127,7 @@ def poly(seq_of_zeros):
elif len(sh) == 1:
pass
else:
- raise ValueError("input must be 1d or square 2d array.")
+ raise ValueError("input must be 1d or non-empty square 2d array.")
if len(seq_of_zeros) == 0:
return 1.0
@@ -806,6 +806,8 @@ def polymul(a1, a2):
poly1d : A one-dimensional polynomial class.
poly, polyadd, polyder, polydiv, polyfit, polyint, polysub,
polyval
+ convolve : Array convolution. Same output as polymul, but has parameter
+ for overlap mode.
Examples
--------
@@ -1191,10 +1193,12 @@ class poly1d(object):
__rtruediv__ = __rdiv__
def __eq__(self, other):
- return NX.alltrue(self.coeffs == other.coeffs)
+ if self.coeffs.shape != other.coeffs.shape:
+ return False
+ return (self.coeffs == other.coeffs).all()
def __ne__(self, other):
- return NX.any(self.coeffs != other.coeffs)
+ return not self.__eq__(other)
def __setattr__(self, key, val):
raise ValueError("Attributes cannot be changed this way.")