dpnp.nancumprod

dpnp.nancumprod(x1, **kwargs)[source]

Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one.

For full documentation refer to numpy.nancumprod.

Limitations

Parameter x is 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.

See also

dpnp.cumprod : Return the cumulative product of elements along a given axis.

Examples

>>> import dpnp as np
>>> a = np.array([1., np.nan])
>>> result = np.nancumprod(a)
>>> [x for x in result]
[1.0, 1.0]
>>> b = np.array([[1., 2., np.nan], [4., np.nan, 6.]])
>>> result = np.nancumprod(b)
>>> [x for x in result]
[1.0, 2.0, 2.0, 8.0, 8.0, 48.0]