Friday, September 5, 2025
HomeLanguagesPython | Numpy np.chebvander() method

Python | Numpy np.chebvander() method

With the help of np.chebvander() method, we can get the Pseudo-Vandermonde matrix from given array having degree which is passed as parameter by using np.chebvander() method.

Syntax : np.chebvander(array, degree)
Return : Return the matrix having size i.e array.size + (degree + 1).

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




# import numpy
import numpy as np
import numpy.polynomial.chebyshev as cheb
  
# using np.chebvander() method
gfg = cheb.chebvander((2, 4, 8, 1), 2)
  
print(gfg)


Output :

[[ 1. 2. 7.]
[ 1. 4. 31.]
[ 1. 8. 127.]
[ 1. 1. 1.]]

Example #2 :




# import numpy
import numpy as np
import numpy.polynomial.chebyshev as cheb
  
# using np.chebvander() method
gfg = cheb.chebvander((3, 5, 1, 10), 4)
  
print(gfg)


Output :

[[1.0000e+00 3.0000e+00 1.7000e+01 9.9000e+01 5.7700e+02]
[1.0000e+00 5.0000e+00 4.9000e+01 4.8500e+02 4.8010e+03]
[1.0000e+00 1.0000e+00 1.0000e+00 1.0000e+00 1.0000e+00]
[1.0000e+00 1.0000e+01 1.9900e+02 3.9700e+03 7.9201e+04]]

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

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6634 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11860 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS