Friday, January 30, 2026
HomeLanguagesPython | Numpy np.chebfromroots() method

Python | Numpy np.chebfromroots() method

With the help of np.chebfromroots() method, we can get the chebyshev series with the roots passed as parameter in np.chebfromroots() method.

Syntax : np.chebfromroots(roots)
Return : Return the chebyshev series.

Example #1 :
In this example we can see that by using np.chebfromroots() method, we are able to get the chebyshev series that is generated by roots those are passed by parameter.




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


Output :

[9.9375e+01 -1.3125e+02 3.5500e+01 -3.7500e+00 1.2500e-01]

Example #2 :




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


Output :

[-5.19125e+02 4.52375e+02 8.00000e+01 -1.24375e+01 -8.75000e-01 6.25000e-02]

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

Most Popular

Dominic
32478 POSTS0 COMMENTS
Milvus
122 POSTS0 COMMENTS
Nango Kala
6849 POSTS0 COMMENTS
Nicole Veronica
11978 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12065 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7222 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6917 POSTS0 COMMENTS