Open In App

Python | Numpy np.hermvander() method

Last Updated : 29 Dec, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

With the help of np.hermvander() method, we can get the pseudo vandermonde matrix from hermite series of given degree by using np.hermvander() method.

Syntax : np.hermvander(x, deg)
Return : Return the pseudo vandermonde matrix of given degree.

Example #1 :
In this example we can see that by using np.hermvander() method, we are able to get the pseudo vandermonde matrix of hermite series by using this method.




# import numpy and hermvander
import numpy as np
from numpy.polynomial.hermite import hermvander
  
x = np.array([1, 2, 3, 5, 7, 11])
deg = 2
  
# using np.hermvander() method
gfg = hermvander(x, deg)
  
print(gfg)


Output :

[[ 1. 2. 2.]
[ 1. 4. 14.]
[ 1. 6. 34.]
[ 1. 10. 98.]
[ 1. 14. 194.]
[ 1. 22. 482.]]

Example #2 :




# import numpy and hermvander
import numpy as np
from numpy.polynomial.hermite import hermvander
  
x = np.array([5, 10, -10, -5])
deg = 3
  
# using np.hermvander() method
gfg = hermvander(x, deg)
  
print(gfg)


Output :

[[ 1.00e+00 1.00e+01 9.80e+01 9.40e+02]
[ 1.00e+00 2.00e+01 3.98e+02 7.88e+03]
[ 1.00e+00 -2.00e+01 3.98e+02 -7.88e+03]
[ 1.00e+00 -1.00e+01 9.80e+01 -9.40e+02]]


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads