diff options
Diffstat (limited to 'numpy/polynomial/polynomial.py')
-rw-r--r-- | numpy/polynomial/polynomial.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index c357b48c9..1be775f6a 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -546,7 +546,7 @@ def polyder(c, m=1, scl=1, axis=0): if cnt == 0: return c - c = np.rollaxis(c, iaxis) + c = np.moveaxis(c, iaxis, 0) n = len(c) if cnt >= n: c = c[:1]*0 @@ -558,7 +558,7 @@ def polyder(c, m=1, scl=1, axis=0): for j in range(n, 0, -1): der[j - 1] = j*c[j] c = der - c = np.rollaxis(c, 0, iaxis + 1) + c = np.moveaxis(c, 0, iaxis) return c @@ -619,7 +619,7 @@ def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0): Note that the result of each integration is *multiplied* by `scl`. Why is this important to note? Say one is making a linear change of variable :math:`u = ax + b` in an integral relative to `x`. Then - .. math::`dx = du/a`, so one will need to set `scl` equal to + :math:`dx = du/a`, so one will need to set `scl` equal to :math:`1/a` - perhaps not what one would have first thought. Examples @@ -662,7 +662,7 @@ def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0): return c k = list(k) + [0]*(cnt - len(k)) - c = np.rollaxis(c, iaxis) + c = np.moveaxis(c, iaxis, 0) for i in range(cnt): n = len(c) c *= scl @@ -676,7 +676,7 @@ def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0): tmp[j + 1] = c[j]/(j + 1) tmp[0] += k[i] - polyval(lbnd, tmp) c = tmp - c = np.rollaxis(c, 0, iaxis + 1) + c = np.moveaxis(c, 0, iaxis) return c @@ -913,7 +913,7 @@ def polyval2d(x, y, c): """ try: x, y = np.array((x, y), copy=0) - except: + except Exception: raise ValueError('x, y are incompatible') c = polyval(x, c) @@ -1026,7 +1026,7 @@ def polyval3d(x, y, z, c): """ try: x, y, z = np.array((x, y, z), copy=0) - except: + except Exception: raise ValueError('x, y, z are incompatible') c = polyval(x, c) @@ -1147,7 +1147,7 @@ def polyvander(x, deg): v[1] = x for i in range(2, ideg + 1): v[i] = v[i-1]*x - return np.rollaxis(v, 0, v.ndim) + return np.moveaxis(v, 0, -1) def polyvander2d(x, y, deg): |