diff options
Diffstat (limited to 'numpy/polynomial/legendre.py')
-rw-r--r-- | numpy/polynomial/legendre.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py index 3ea68a5e6..e5b9ffe87 100644 --- a/numpy/polynomial/legendre.py +++ b/numpy/polynomial/legendre.py @@ -679,9 +679,9 @@ def legder(cs, m=1, scl=1) : cnt = int(m) if cnt != m: - raise ValueError, "The order of derivation must be integer" + raise ValueError("The order of derivation must be integer") if cnt < 0 : - raise ValueError, "The order of derivation must be non-negative" + raise ValueError("The order of derivation must be non-negative") # cs is a trimmed copy [cs] = pu.as_series([cs]) @@ -783,11 +783,11 @@ def legint(cs, m=1, k=[], lbnd=0, scl=1): k = [k] if cnt != m: - raise ValueError, "The order of integration must be integer" + raise ValueError("The order of integration must be integer") if cnt < 0 : - raise ValueError, "The order of integration must be non-negative" + raise ValueError("The order of integration must be non-negative") if len(k) > cnt : - raise ValueError, "Too many integration constants" + raise ValueError("Too many integration constants") # cs is a trimmed copy [cs] = pu.as_series([cs]) @@ -1023,15 +1023,15 @@ def legfit(x, y, deg, rcond=None, full=False, w=None): # check arguments. if deg < 0 : - raise ValueError, "expected deg >= 0" + raise ValueError("expected deg >= 0") if x.ndim != 1: - raise TypeError, "expected 1D vector for x" + raise TypeError("expected 1D vector for x") if x.size == 0: - raise TypeError, "expected non-empty vector for x" + raise TypeError("expected non-empty vector for x") if y.ndim < 1 or y.ndim > 2 : - raise TypeError, "expected 1D or 2D array for y" + raise TypeError("expected 1D or 2D array for y") if len(x) != len(y): - raise TypeError, "expected x and y to have same length" + raise TypeError("expected x and y to have same length") # set up the least squares matrices lhs = legvander(x, deg) @@ -1039,9 +1039,9 @@ def legfit(x, y, deg, rcond=None, full=False, w=None): if w is not None: w = np.asarray(w) + 0.0 if w.ndim != 1: - raise TypeError, "expected 1D vector for w" + raise TypeError("expected 1D vector for w") if len(x) != len(w): - raise TypeError, "expected x and w to have same length" + raise TypeError("expected x and w to have same length") # apply weights if rhs.ndim == 2: lhs *= w[:, np.newaxis] |