Python | Numpy np.legfromroots() method Last Updated : 31 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report np.legfromroots() method is used to generate a legendre series with given roots. Syntax : np.legfromroots(roots) Parameters: roots :[array_like] Input sequence containing the roots. Return : [ndarray] 1-D array of coefficients of legendre series. Code #1 : Python3 # Python program explaining # numpy.legfromroots() method # importing numpy as np # and numpy.polynomial.legendre module as geek import numpy as np import numpy.polynomial.legendre as geek # Input roots roots = (2, 4, 8) # using np.legfromroots() method res = geek.legfromroots(roots) # Resulting legendre series coefficient print (res) Output: [-68.66666667 56.6 -9.33333333 0.4 ] Code #2 : Python3 # Python program explaining # numpy.legfromroots() method # importing numpy as np # and numpy.polynomial.legendre module as geek import numpy as np import numpy.polynomial.legendre as geek # Input roots s = (1, 2, 3, 4, 5) # using np.legfromroots() method res = geek.legfromroots(s) # Resulting legendre series coefficient print (res) Output: [ -1.98000000e+02 3.25428571e+02 -1.58571429e+02 3.44444444e+01 -3.42857143e+00 1.26984127e-01] Comment More infoAdvertise with us Next Article Python | Numpy np.legfromroots() method J jana_sayantan Follow Improve Article Tags : Python Python-numpy Python numpy-Mathematical Function Practice Tags : python Similar Reads Python | Numpy np.lagfromroots() method np.lagfromroots() method is used to generate a Laguerre series with given roots. Syntax : np.lagfromroots(roots) Parameters: roots :[array_like] Input sequence containing the roots. Return : [ndarray] 1-D array of coefficients of Laguerre series. Code #1 : Python3 # Python program explaining # numpy 1 min read Python | Numpy np.legroots() method np.legroots() method is used to compute the roots of a legendre series.Return the roots of the polynomial. Syntax : np.legroots(c) Parameters: c :[array_like] 1-D arrays of legendre series coefficients. Return : [ndarray] Array of the roots of the series. If all the roots are real, then out is also 1 min read Python | Numpy np.hermfromroots() method With the help of np.hermfromroots() method, we can get the hermite series coefficient from given roots by using np.hermfromroots() method. Syntax : np.hermfromroots(roots) Return : Return the coefficient of hermite series. Example #1 : In this example we can see that by using np.hermfromroots() meth 1 min read Python | Numpy np.hermefromroots() method With the help of np.hermefromroots() method, we can get the hermiteE series from given roots by using np.hermefromroots() method. Syntax : np.hermefromroots(roots) Return : Return the hermiteE series. Example #1 : In this example we can see that by using np.hermefromroots() method, we are able to ge 1 min read Python | Numpy np.lagroots() method np.lagroots() method is used to compute the roots of a Laguerre series.Return the roots of the polynomial. Syntax : np.lagroots(c) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Array of the roots of the series. If all the roots ar 1 min read Like