dpnp.trapz

dpnp.trapz(y1, x1=None, dx=1.0, axis=- 1)[source]

Integrate along the given axis using the composite trapezoidal rule.

For full documentation refer to numpy.trapz.

Limitations

Parameters y and x are supported as dpnp.ndarray. Keyword arguments kwargs are currently unsupported. Otherwise the functions will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.

Examples

>>> import dpnp as np
>>> a = np.array([1, 2, 3])
>>> b = np.array([4, 6, 8])
>>> np.trapz(a)
4.0
>>> np.trapz(a, x=b)
8.0
>>> np.trapz(a, dx=2)
8.0