Generate Chebyshev series with given complex roots using NumPy in Python Last Updated : 03 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will cover how to generate the Chebyshev series with given complex roots in Python using NumPy. Example Input: (4+5j) Output: [9.5-40.j 0. +0.j 0.5 +0.j] Explanation: An array of Chebyshev series.chebyshev.chebfromroots() method In python, the Chebyshev module provides many functions like chebfromroots to perform arithmetic, and calculus operations on the Chebyshev series. It is one of the functions provided by the Chebyshev class that returns an array of coefficients. This method is used to generate the Chebyshev series which is available in the NumPy module in python. Below is the syntax of the chebfromroots method. If all roots are real then the output will be a real array,If any of the roots are complex, the output is a complex array. Syntax: chebyshev.chebfromroots((-my_value, my_value)) Parameter: my_value: is the complex number. Return: 1-D array of coefficients. Example 1: In this example, we will create a complex number using a complex function, which will return an array of Chebyshev roots. Python3 # import chebyshev from numpy.polynomial import chebyshev # create a complex variable my_value = complex(4,5) # display value print("Complex value: ", my_value) # generate chebyshev roots print("chebyshev roots: ", chebyshev.chebfromroots((-my_value, my_value))) Output: Complex value: (4+5j) chebyshev roots: [9.5-40.j 0. +0.j 0.5 +0.j]Example 2: In this example, we will create a complex variable -> 45+4j and generate Chebyshev roots. We can also get the shape and dimensions of the resultant array using dim and shape functions. Python3 # import chebyshev from numpy.polynomial import chebyshev # create a complex variable my_value = complex(45,4) # display value print("Complex value: ", my_value) # generate chebyshev roots print("chebyshev roots: ", chebyshev.chebfromroots( (-my_value, my_value))) # get the dimensions print("Dimensions: ", chebyshev.chebfromroots( (-my_value, my_value)).ndim) # get the shape print("shape: ",chebyshev.chebfromroots( (-my_value, my_value)).shape) Output: Complex value: (45+4j) chebyshev roots: [-2.0085e+03-360.j 0.0000e+00 +0.j 5.0000e-01 +0.j] Dimensions: 1 shape: (3,) Comment More infoAdvertise with us Next Article Compute the Roots of a Hermite_e series with given Complex Roots using NumPy in Python S sravankumar_171fa07058 Follow Improve Article Tags : Python Python-numpy Python numpy-polynomials Practice Tags : python Similar Reads Generate a Hermite_e series with given roots using NumPy in Python In this article, we will cover how to raise a Hermite_e series to power in Python using NumPy. hermite_e.hermefromroots() function We use the hermite_e.hermefromroots() function present in the NumPy module of python to construct a Hermite_e series with the given roots. A 1-D array of coefficients is 2 min read Generate a Legendre series with given complex roots in Python In this article, we will cover how to generate the Legendre series with given complex roots in Python using NumPy. ExampleInput: (4+5j) Output: [9.33333333-40.j 0. +0.j 0.66666667 +0.j] Explanation: An array of legendre series.legendre.legfromroots method In python, the Legendre module provides many 2 min read Compute the roots of a Chebyshev series using NumPy in Python This article will discuss how to compute the roots of a Chebyshev series in NumPy using Python. Chebyshev polynomials are important in approximation theory these are never formally generated. Only the coefficients are required for all calculations. If we want to compute the roots of a polynomial we 2 min read Compute the Roots of a Hermite_e series with given Complex Roots using NumPy in Python In this article, we are going to see how to compute the roots of a Hermite_e series with given complex roots in Python. NumPy hermeroots() Methods We use the hermite e.hermeroots() function in Python Numpy to get the roots of a Hermite e series. This function will return an array containing the seri 2 min read Generate a Legendre series with given roots in Python In this article, we will see how to generate a Legendre series with given roots in Python. Legendre classIn python, the Legendre module provides many functions like legfromroots to perform arithmetic, and calculus operations on the Legendre series. It is one of the functions provided by the Legendre 2 min read Generate a Monic Polynomial with given Complex roots in Python In this article, we will see how can we generate a monic polynomial with given complex roots in python, for this purpose, we will use NumPy library of python, NumPy is the fundamental package for scientific computing with Python. NumPy is a general-purpose array processing package that provides tool 4 min read Like