Python | Numpy np.lagcompanion() method Last Updated : 29 Dec, 2019 Comments Improve Suggest changes Like Article Like Report np.lagcompanion() method is used to return the companion matrix of Laguerre series. Syntax : np.lagcompanion(c) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Companion matrix of dimensions (deg, deg). Code #1 : Python3 # Python program explaining # numpy.lagcompanion() method # importing numpy as np # and numpy.polynomial.laguerre module as geek import numpy as np import numpy.polynomial.laguerre as geek # Input laguerre series coefficients s = (2, 4, 8) # using np.lagcompanion() method res = geek.lagcompanion(s) # Resulting Companion matrix print (res) Output: [[ 1. -0.5] [-1. 4. ]] Code #2 : Python3 # Python program explaining # numpy.lagcompanion() method # importing numpy as np # and numpy.polynomial.laguerre module as geek import numpy as np import numpy.polynomial.laguerre as geek # Laguerre series coefficients s = (1, 2, 3, 4, 5) # using np.lagcompanion() method res = geek.lagcompanion(s) # Resulting Companion matrix print (res) Output: [[ 1. -1. 0. 0.8] [ -1. 3. -2. 1.6] [ 0. -2. 5. -0.6] [ 0. 0. -3. 10.2]] Comment More infoAdvertise with us Next Article Python | Numpy np.lagcompanion() method jana_sayantan Follow Improve Article Tags : Python Python-numpy Python numpy-Mathematical Function Practice Tags : python Similar Reads Python | Numpy np.legcompanion() method np.legcompanion() method is used to return the companion matrix of legendre series. Syntax : np.legcompanion(c) Parameters: c :[array_like] 1-D arrays of legendre series coefficients ordered from low to high. Return : [ndarray] Companion matrix of dimensions (deg, deg). Code #1 : Python3 # Python pr 1 min read Python | Numpy np.lagone() method np.lagone() method can be used instead of np.ones for creating a array whose elements are 1. Syntax : np.lagone() Return : Return array([1]) Example #1 : Python3 1=1 # Python program explaining # numpy.lagone() method # import numpy and lagone import numpy as np from numpy.polynomial.laguerre import 1 min read Python | Numpy np.lagpow() method np.lagpow() method is used to raise a Laguerre series to a given power.It returns the Laguerre series c raised to the power pow. Syntax : np.lagpow(c, pow, maxpower=16) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. pow :[integer] Power to which the 2 min read Python | Numpy np.lagint() method With the help of np.lagint() method, we can get the laguerre series in the form of an array by using np.lagint() method. Syntax : np.lagint(array of coefficient) Return : Return the array of laguerre series. Example #1 : In this example we can see that by using np.lagint() method, we are able to get 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 Python | Numpy np.lag2poly() method np.lag2poly() method is used to convert a Laguerre series to a polynomial. Syntax : np.lag2poly(c) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] 1-D array containing the coefficients of the equivalent polynomial. Code #1 : Python3 1 min read Python | Numpy np.lagmul() method np.lagmul() method is used to multiply one Laguerre series to another.It returns the product of two Laguerre series c1 * c2. Syntax : np.lagmul(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Laguerre series coefficie 1 min read Python | Numpy np.lagfit() method With the help of np.lagfit() method, we can get the least squares fit of laguerre series of a given data by using np.lagfit() method. Syntax : np.lagfit(x, y, deg) Return : Return the least squares fit of laguerre series to data. Example #1 : In this example we can see that by using np.lagfit() meth 1 min read Python | Numpy np.lagadd() method np.lagadd() method is used to add one Laguerre series to another.It returns the sum of two Laguerre series c1 + c2. Syntax : np.lagadd(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Array representing the Laguerre se 1 min read Python | Numpy np.lagdiv() method np.lagdiv() method is used to divide one Laguerre series to another.It returns the quotient-with-remainder of two Laguerre series c1 / c2. Syntax : np.lagdiv(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Laguerre se 1 min read Like