Python | Numpy polynomial legint() method
np.legint() method is used to integrate a Legendre series.
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.
Return : [ndarray] Legendre series coefficient array of the integral.
Code #1 :
[ 0.66666667 0.4 1.33333333 1.6 ]
Code #2 :
[-1.66666667 4. 0.95238095 0.44444444 5.71428571 5.55555556]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course