Python | The numpy np.hermetrim () method

With the np.hermetrim() method we can trim the final values ​​in a series of hermiteE coefficients using np.hermtrim () .

Syntax: np.hermetrim (series, tol)
Return: Return the coefficients of series after trimming.

Example # 1:
In this example we can see that with np.hermetrim () we can get the clipped hermiteE row using this method.

# import numpy and herm1trim

import numpy as np

from numpy.polynomial.hermite_e import hermetrim

  

series = np.array ([ 2 , 0 , 4 , 0 , 6 , 1 , 1 , 1 ])

 
# using the np.hermetrim () method

gfg = hermetrim (series, tol = 1 )

  

print (gfg)

Output:

[2. 0. 4. 0. 6.]

Example # 2:

# NumPy imports and Hermetrim

import numpy as np

from numpy.polynomial.hermite_e import hermetrim

 

series = np.array ([ 1 , 0 , 0 , 0 , 0 , 0 ])

  
# using the np.hermetrim () method

gfg = hermetrim (series, tol = 0 )

  

print (gfg)

Output:

[1.]





Get Solution for free from DataCamp guru