Python | Numpy np.chebroots () method

NumPy | Python Methods and Functions

Using the np.chebroots() method, we can get the roots of the Chebyshev series using np.chebroots () .

Syntax: np.chebroots (array of coefficients)
Return: Return the array having roots of chebyshev series.

Example # 1:
In this example, we see that with np.chebroots () we we can get the roots of Chebyshev rows using this method.

# NumPy imports

import numpy as np

import numpy. polynomial.chebyshev as cheb

 
# using the np.chebroots () method

gfg  = cheb.chebroots (( 2 , 4 , 8 , 1 ))

 

print (gfg)

Output:

[-3.83265557 -0.71484143 0.54749701]

Example # 2:

# NumPy import

import numpy as np

import numpy.polynomial.chebyshev as cheb

  # using the np.chebroots () method

gfg = cheb.chebroots (( - 3 , 4 , - 5 , 1 , 10 ))

 

print (gfg)

Output:

[-1.02213642 -0.38135467 0.40624906 0.94724203]





Get Solution for free from DataCamp guru