Python | Numpy np.lag2poly() method (original) (raw)
Last Updated : 29 Dec, 2019
**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 :
import
numpy as np
import
numpy.polynomial.laguerre as geek
c
=
np.array([
0.1
,
0.2
,
0.3
,
0.4
,
0.5
])
res
=
geek.lag2poly(c)
print
(res)
Output:
[ 1.5 -4. 2.25 -0.4 0.02083333]
Code #2 :
import
numpy as np
import
numpy.polynomial.laguerre as geek
c
=
(
1
,
2
,
3
,
4
,
5
)
res
=
geek.lag2poly(c)
print
(res)
Output:
[ 15. -40. 22.5 -4. 0.20833333]
Similar Reads
- Python | Numpy np.leg2poly() method np.leg2poly() method is used to convert a legendre series to a polynomial. Syntax : np.leg2poly(c) Parameters: c :[array_like] 1-D arrays of legendre series coefficients ordered from low to high. Return : [ndarray] 1-D array containing the coefficients of the equivalent polynomial. Code #1 : # Pytho 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.lagval() method With the help of np.lagval() method, we can get the laguerre series at point x by using np.lagval() method. Syntax : np.lagval(x, c) Return : Return the laguerre series at point x. Example #1 : In this example we can see that by using np.lagval() method, we are able to get the laguerre series at poi 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.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 : # Python program explaining # numpy.lagone() method # import numpy and lagone import numpy as np from numpy.polynomial.laguerre import lagone # us 1 min read
- Python | Numpy np.lagzero() method np.lagzero() method can be used instead of np.zeros for creating a array whose elements are 0. Syntax : np.lagzero() Return : Return array([0]) Example #1 : # Python program explaining # numpy.lagzero() method # import numpy and lagzero import numpy as np from numpy.polynomial.laguerre import lagzer 1 min read
- Python | Numpy np.herm2poly method With the help of np.herm2poly() method, we can get the polynomial from hermite series by using np.herm2poly() method. Syntax : np.herm2poly(hermite series) Return : Return the coefficient of polynomial. Example #1 : In this example we can see that by using np.herm2poly() method, we are able to get t 1 min read
- Python | Numpy np.lagmulx() method With the help of np.lagmulx() method, we can get the multiplication of Laguerre series with x by using np.lagmulx() method, where x is an independent variable. Syntax : np.lagmulx(series) Return : Return the coefficient of series after multiplication. Example #1 : In this example we can see that by 1 min read
- Python | Numpy np.herme2poly() method With the help of np.herme2poly() method, we can get the polynomial from hermiteE series by using np.herme2poly() method. Syntax : np.herme2poly(series) Return : Return the coefficients of polynomial. Example #1 : In this example we can see that by using np.herme2poly() method, we are able to get the 1 min read
- Python | Numpy np.lagval2d() method With the help of np.lagval2d() method, we can get the 2-D laguerre series at point x by using np.lagval2d() method. Syntax : np.lagval2d(x, y, c) Return : Return the 2-D laguerre series at point x and y. Example #1 : In this example we can see that by using np.lagval2d() method, we are able to get t 1 min read