Did I find the right examples for you? yes no

# numpy.polynomial.hermite.poly2herm

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)
```poly2herm(pol)

Convert a polynomial to a Hermite series.

Convert an array representing the coefficients of a polynomial (relative
to the "standard" basis) ordered from lowest degree to highest, to an
array of the coefficients of the equivalent Hermite series, ordered
from lowest to highest degree.

Parameters(more...)
```

```        def poly2herm(pol) :
"""
poly2herm(pol)

Convert a polynomial to a Hermite series.

Convert an array representing the coefficients of a polynomial (relative
to the "standard" basis) ordered from lowest degree to highest, to an
array of the coefficients of the equivalent Hermite series, ordered
from lowest to highest degree.

Parameters
----------
pol : array_like
1-D array containing the polynomial coefficients

Returns
-------
c : ndarray
1-D array containing the coefficients of the equivalent Hermite
series.

--------
herm2poly

Notes
-----
The easy way to do conversions between polynomial basis sets
is to use the convert method of a class instance.

Examples
--------
>>> from numpy.polynomial.hermite_e import poly2herme
>>> poly2herm(np.arange(4))
array([ 1.   ,  2.75 ,  0.5  ,  0.375])

"""
[pol] = pu.as_series([pol])
deg = len(pol) - 1
res = 0
for i in range(deg, -1, -1) :
res = hermadd(hermmulx(res), pol[i])
return res
```

```            pol = [0]*i + [1]
tgt = [i] + [0]*i + [1/scl]
hermpol = herm.poly2herm(pol)
hermint = herm.hermint(hermpol, m=1, k=[i])
res = herm.herm2poly(hermint)
```
```            scl = i + 1
pol = [0]*i + [1]
hermpol = herm.poly2herm(pol)
hermint = herm.hermint(hermpol, m=1, k=[i], lbnd=-1)
assert_almost_equal(herm.hermval(-1, hermint), i)
```
```            pol = [0]*i + [1]
tgt = [i] + [0]*i + [2/scl]
hermpol = herm.poly2herm(pol)
hermint = herm.hermint(hermpol, m=1, k=[i], scl=2)
res = herm.herm2poly(hermint)
```
```    def test_poly2herm(self) :
for i in range(10) :
assert_almost_equal(herm.poly2herm(Hlist[i]), [0]*i + [1])

def test_weight(self):
```

```            pol = [0]*i + [1]
tgt = [i] + [0]*i + [1/scl]
hermpol = herm.poly2herm(pol)
hermint = herm.hermint(hermpol, m=1, k=[i])
res = herm.herm2poly(hermint)
```
```            scl = i + 1
pol = [0]*i + [1]
hermpol = herm.poly2herm(pol)
hermint = herm.hermint(hermpol, m=1, k=[i], lbnd=-1)
assert_almost_equal(herm.hermval(-1, hermint), i)
```
```            pol = [0]*i + [1]
tgt = [i] + [0]*i + [2/scl]
hermpol = herm.poly2herm(pol)
hermint = herm.hermint(hermpol, m=1, k=[i], scl=2)
res = herm.herm2poly(hermint)
```
```    def test_poly2herm(self) :
for i in range(10) :
assert_almost_equal(herm.poly2herm(Hlist[i]), [0]*i + [1])

def test_weight(self):
```