Friday, October 10, 2025
HomeLanguagesPython | Numpy np.hermevander2d() method

Python | Numpy np.hermevander2d() method

With the help of np.hermevander2d() method, we can get the pseudo vandermonde matrix of a given 2-D data having degrees x and y by using np.hermevander2d() method.

Syntax : np.hermevander2d(x, y, [x_deg, y_deg])
Return : Return the pseudo vandermonde matrix of given 2-D data.

Example #1 :
In this example we can see that by using np.hermevander2d() method, we are able to get the pseudo vandermonde matrix of a given 2-D data having degree (x, y) by using this method.




# import numpy and hermevander2d
import numpy as np
from numpy.polynomial.hermite_e import hermevander2d
  
x = np.array([0.1, 0.2])
y = np.array([2, 0.2])
x_deg, y_deg = 2, 3
# using np.hermevander2d() method
gfg = hermevander2d(x, y, [x_deg, y_deg])
  
print(gfg)


Output :

[[ 1. 2. 3. 2. 0.1 0.2 0.3 0.2
-0.99 -1.98 -2.97 -1.98 ]
[ 1. 0.2 -0.96 -0.592 0.2 0.04 -0.192 -0.1184
-0.96 -0.192 0.9216 0.56832]]

Example #2 :




# import numpy and hermevander2d
import numpy as np
from numpy.polynomial.hermite_e import hermevander2d
  
x = np.array([1.01, 2.02, 3.03])
y = np.array([10.1, 20.2, 30.3])
x_deg, y_deg = 1, 1
# using np.hermevander2d() method
gfg = hermevander2d(x, y, [x_deg, y_deg])
  
print(gfg)


Output :

[[ 1. 10.1 1.01 10.201]
[ 1. 20.2 2.02 40.804]
[ 1. 30.3 3.03 91.809]]

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32349 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6715 POSTS0 COMMENTS
Nicole Veronica
11878 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6837 POSTS0 COMMENTS
Ted Musemwa
7097 POSTS0 COMMENTS
Thapelo Manthata
6792 POSTS0 COMMENTS
Umr Jansen
6791 POSTS0 COMMENTS