Open In App

Python | Numpy np.chebval() method

Last Updated : 11 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

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]


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads