numpy.polynomial.laguerre.lagtrim(c, tol=0)
[source]
Remove “small” “trailing” coefficients from a polynomial.
“Small” means “small in absolute value” and is controlled by the parameter tol
; “trailing” means highest order coefficient(s), e.g., in [0, 1, 1, 0, 0]
(which represents 0 + x + x**2 + 0*x**3 + 0*x**4
) both the 3rd and 4th order coefficients would be “trimmed.”
Parameters: 


Returns: 

Raises: 

See also
trimseq
>>> from numpy.polynomial import polyutils as pu >>> pu.trimcoef((0,0,3,0,5,0,0)) array([0., 0., 3., 0., 5.]) >>> pu.trimcoef((0,0,1e3,0,1e5,0,0),1e3) # item == tol is trimmed array([0.]) >>> i = complex(0,1) # works for complex >>> pu.trimcoef((3e4,1e3*(1i),5e4,2e5*(1+i)), 1e3) array([0.0003+0.j , 0.001 0.001j])
© 2005–2019 NumPy Developers
Licensed under the 3clause BSD License.
https://docs.scipy.org/doc/numpy1.17.0/reference/generated/numpy.polynomial.laguerre.lagtrim.html