This is documentation for an old release of NumPy (version 1.3.). Read this page in the documentation of the latest stable release (version > 1.17).
Integrate along the given axis using the composite trapezoidal rule.
Integrate y (x) along given axis.
Parameters: | y : array_like
x : array_like, optional
dx : scalar, optional
axis : int, optional
|
---|
Examples
>>> np.trapz([1,2,3])
>>> 4.0
>>> np.trapz([1,2,3], [4,6,8])
>>> 8.0