From 029863eae86b9df2de4b9a9843ca8f88c99130df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Fri, 11 Aug 2017 03:01:06 +0200 Subject: MAINT: Use moveaxis instead of rollaxis internally (#9475) Also add a hint to the documentation advising the use of moveaxis over rollaxis. Tests for rollaxis are left alone. --- numpy/polynomial/hermite_e.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'numpy/polynomial/hermite_e.py') diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py index 2fafea4af..e83b26327 100644 --- a/numpy/polynomial/hermite_e.py +++ b/numpy/polynomial/hermite_e.py @@ -705,7 +705,7 @@ def hermeder(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: return c[:1]*0 @@ -717,7 +717,7 @@ def hermeder(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 @@ -824,7 +824,7 @@ def hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0): if cnt == 0: return c - c = np.rollaxis(c, iaxis) + c = np.moveaxis(c, iaxis, 0) k = list(k) + [0]*(cnt - len(k)) for i in range(cnt): n = len(c) @@ -839,7 +839,7 @@ def hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0): tmp[j + 1] = c[j]/(j + 1) tmp[0] += k[i] - hermeval(lbnd, tmp) c = tmp - c = np.rollaxis(c, 0, iaxis + 1) + c = np.moveaxis(c, 0, iaxis) return c @@ -1226,7 +1226,7 @@ def hermevander(x, deg): v[1] = x for i in range(2, ideg + 1): v[i] = (v[i-1]*x - v[i-2]*(i - 1)) - return np.rollaxis(v, 0, v.ndim) + return np.moveaxis(v, 0, -1) def hermevander2d(x, y, deg): -- cgit v1.2.1