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 argument kwargs is currently unsupported. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Available array 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]