np.legint()
方法用于集成Legendre系列。
用法:np.legint(c, m=1, k=[], lbnd=0, scl=1, axis=0)
参数:
c :[array_like] Array of Legendre series coefficients.
m :[int] Order of integration, must be positive.Default is 1.
k :[[], list, scalar] Integration constant(s). The value of the first integral at lbnd is the first value in the list, the value of the second integral at lbnd is the second value, etc. If k == [] (the default), all constants are set to zero.
lband :[scalar, optional] The lower bound of the integral.Default is 0.
scl :[scalar, optional] For each integration the result is multiplied by scl before the integration constant is added.Default is 1.
axis :[scalar, optional] Axis over which the integral is taken.Default is 0.
返回:[ndarray]勒让德级数的整数系数数组。
代码1:
# Python program explaining
# numpy.legint() method
# importing numpy as np
# and numpy.polynomial.legendre module as geek
import numpy as np
import numpy.polynomial.legendre as geek
# Legendre series coefficients
s1 = (2, 4, 8)
# using np.legint() method
res = geek.legint(s1)
# Resulting legendre series
print (res)
输出:
[ 0.66666667 0.4 1.33333333 1.6 ]
代码2:
# Python program explaining
# numpy.legint() method
# importing numpy as np
# and numpy.polynomial.legendre module as geek
import numpy as np
import numpy.polynomial.legendre as geek
# Legendre series coefficients
s1 = (10, 20, 30, 40, 50)
# using np.legint() method
res = geek.legint(s1)
# Resulting legendre series
print (res)
输出:
[-1.66666667 4. 0.95238095 0.44444444 5.71428571 5.55555556]
相关用法
- Python Numpy polynomial lagline()用法及代码示例
- Python Numpy polynomial legline()用法及代码示例
- Python Numpy np.fft()用法及代码示例
- Python numpy.ma.ids()用法及代码示例
- Python Numpy np.chebval3d()用法及代码示例
- Python Numpy np.lagone()用法及代码示例
- Python Numpy np.lagzero()用法及代码示例
- Python Numpy np.chebfromroots()用法及代码示例
- Python Numpy np.chebgrid2d()用法及代码示例
- Python Numpy np.chebgrid3d()用法及代码示例
- Python Numpy np.lag2poly()用法及代码示例
- Python Numpy np.lagcompanion()用法及代码示例
- Python Numpy np.kron()用法及代码示例
注:本文由纯净天空筛选整理自jana_sayantan大神的英文原创作品 Python | Numpy polynomial legint() method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。