summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polynomial.py
diff options
context:
space:
mode:
authorNico Schlömer <nico.schloemer@gmail.com>2017-08-11 03:01:06 +0200
committerEric Wieser <wieser.eric@gmail.com>2017-08-10 20:01:06 -0500
commit029863eae86b9df2de4b9a9843ca8f88c99130df (patch)
treeced3f88544979e2dc6f7eb327963c5d2688374ef /numpy/polynomial/polynomial.py
parent4c18530b1e3e428a3755c6847f70322ec12bdbc2 (diff)
downloadnumpy-029863eae86b9df2de4b9a9843ca8f88c99130df.tar.gz
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.
Diffstat (limited to 'numpy/polynomial/polynomial.py')
-rw-r--r--numpy/polynomial/polynomial.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index 4b343bf7d..1528de342 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
@@ -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
@@ -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):