cupy.trapz#
- cupy.trapz(y, x=None, dx=1.0, axis=- 1)[source]#
Integrate along the given axis using the composite trapezoidal rule. Integrate y (x) along the given axis.
- Parameters
y (cupy.ndarray) – Input array to integrate.
x (cupy.ndarray) – Sample points over which to integrate. If None equal spacing dx is assumed.
dx (float) – Spacing between sample points, used if x is None, default is 1.
axis (int) – The axis along which the integral is taken, default is the last axis.
- Returns
Definite integral as approximated by the trapezoidal rule.
- Return type
See also