summaryrefslogtreecommitdiff
path: root/numpy/polynomial/hermite_e.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/hermite_e.py')
-rw-r--r--numpy/polynomial/hermite_e.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py
index 2a29d61cf..ee29ec5d3 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
@@ -781,7 +781,7 @@ def hermeint(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.
Also note that, in general, the result of integrating a C-series needs
@@ -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
@@ -981,12 +981,12 @@ def hermeval2d(x, y, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
try:
x, y = np.array((x, y), copy=0)
- except:
+ except Exception:
raise ValueError('x, y are incompatible')
c = hermeval(x, c)
@@ -1041,7 +1041,7 @@ def hermegrid2d(x, y, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
c = hermeval(x, c)
@@ -1094,12 +1094,12 @@ def hermeval3d(x, y, z, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
try:
x, y, z = np.array((x, y, z), copy=0)
- except:
+ except Exception:
raise ValueError('x, y, z are incompatible')
c = hermeval(x, c)
@@ -1158,7 +1158,7 @@ def hermegrid3d(x, y, z, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
c = hermeval(x, 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):
@@ -1276,7 +1276,7 @@ def hermevander2d(x, y, deg):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
ideg = [int(d) for d in deg]
@@ -1340,7 +1340,7 @@ def hermevander3d(x, y, z, deg):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
ideg = [int(d) for d in deg]
@@ -1582,7 +1582,7 @@ def hermecompanion(c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
# c is a trimmed copy
@@ -1730,7 +1730,7 @@ def hermegauss(deg):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
The results have only been tested up to degree 100, higher degrees may
be problematic. The weights are determined by using the fact that
@@ -1793,7 +1793,7 @@ def hermeweight(x):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
w = np.exp(-.5*x**2)