Python | Numpy np.lagtrim() method (original) (raw)
Last Updated : 23 Jan, 2020
With the help of **np.lagtrim()**
method, we can trim the small trailing values of the polynomial by using np.lagtrim()
method.
Syntax :
np.lagtrim(c, tol)
Return : Return the trimmed values from the polynomial.
Example #1 :
In this example we can see that by using np.lagtrim()
method, we are able to get the trimmed values of a polynomial by removing trailing values by using this method.
import
numpy as np
from
numpy.polynomial.laguerre
import
lagtrim
gfg
=
lagtrim([
1
,
2
,
3
,
0
,
0
],
0
)
print
(gfg)
Output :
[1. 2. 3.]
Example #2 :
import
numpy as np
from
numpy.polynomial.laguerre
import
lagtrim
gfg
=
lagtrim([
0
,
1
,
2
,
3
],
3
)
print
(gfg)
Output :
[0.]
Similar Reads
- 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
- 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.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.lagder() method np.lagroots() method is used to differentiate a Laguerre series. Syntax : np.lagder(c, m=1, scl=1, axis=0) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. m :[int, optional] Number of derivatives taken, must be non-negative.Default is 1. scl :[scalar, 1 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.laggrid2d() method np.laggrid2d() method is used to evaluate a 2-D Laguerre series on the Cartesian product of x and y. Syntax : np.laggrid2d(x, y, c) Parameters: x, y :[array_like]The two dimensional series is evaluated at the points in the Cartesian product of x and y. If x or y is a list or tuple, it is first conve 2 min read
- Python | Numpy np.laggrid3d() method np.laggrid3d() method is used to evaluate a 3-D Laguerre series on the Cartesian product of x, y and z. Syntax : np.laggrid3d(x, y, z, c) Parameters: x, y, z :[array_like]The three dimensional series is evaluated at the points in the Cartesian product of x, y and z. If x or y or z is a list or tuple 2 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.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.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