Python | Numpy np.herme2poly () method

NumPy | Python Methods and Functions

Using the np.herme2poly() method, we can get a polynomial from the hermiteE series using np.herme2poly () .

Syntax: np.herme2poly (series)
Return: Return the coefficients of polynomial.

Example # 1:
In this example we see that with np.herme2poly () we can get the coefficients of the polynomial from the hermiteE row using this method.

# import numpy and herme2poly

import numpy as np

from numpy. polynomial.hermite_e import herme2poly

 

= np.array ([ 0.1 , 0.2 , 0.3 , 0.4 , 0.5 ])

# using the np.herme2poly () method

gfg = herme2poly (x)

 

print (gfg)

Output:

[ 1.3 -1. -2.7 0.4 0.5]

Example # 2:

# import numpy and herme2poly

import numpy as np

from numpy.polynomial.hermite_e import herme2poly

 

x = np.array ([ - 0.5 , - 0.4 , - 0.3 , - 0.2 , - 0.1 , 0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 ])

# using the np.herme2poly () method

gfg = herme2poly (x)

 

print (gfg)

Output:

[-4.4300e + 02 3.5720e + 02 2.2413e + 03 -4.8320e + 02 -1.5136e + 03 1.4700e + 02
3.0670e + 02 -1.4200e + 01 -2.2200e + 01 4.0000e-01 5.0000e-01]





Get Solution for free from DataCamp guru