Friday, October 17, 2025
HomeLanguagesPython | Numpy np.chebval() method

Python | Numpy np.chebval() method

With the help of np.chebval() method, we can get the array of coefficients after evaluation of x on chebyshev series by using np.chebval() method.

Syntax : np.chebval(x, c)
Return : Return an array after evaluation on x.

Example #1 :
In this example we can see that by using np.chebval() method, we are able to get the array of coefficients by evaluating x on chebyshev series.




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


Output :

[ 1. 31.]

Example #2 :




# import numpy
import numpy as np
import numpy.polynomial.chebyshev as cheb
  
# using np.chebval() method
gfg = cheb.chebval((1, 3, 5, 7), (2, -4, 1, 5, 1))
  
print(gfg)


Output :

[5.0000e+00 1.0790e+03 7.2570e+03 2.5643e+04]

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

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS