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 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 None.

  • 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

cupy.ndarray

See also

numpy.trapz()