dpnp.isnan

dpnp.isnan(x, out=None, where=True, order='K', dtype=None, subok=True, **kwargs)

Checks if each element of an input array is a NaN.

For full documentation refer to numpy.isnan.

Parameters:
  • x ({dpnp.ndarray, usm_ndarray}) – Input array, expected to have numeric data type.

  • out ({None, dpnp.ndarray}, optional) – Output array to populate. Array must have the correct shape and the expected data type.

  • order ({"C", "F", "A", "K"}, optional) – Memory layout of the newly output array, if parameter out is None. Default: “K”.

Returns:

out – An array which is True where x is NaN, False otherwise. The data type of the returned array is bool.

Return type:

dpnp.ndarray

Limitations

Parameters where and subok are supported with their default values. Otherwise NotImplementedError exception will be raised.

See also

dpnp.isinf

Test element-wise for positive or negative infinity.

dpnp.isneginf

Test element-wise for negative infinity, return result as bool array.

dpnp.isposinf

Test element-wise for positive infinity, return result as bool array.

dpnp.isfinite

Test element-wise for finiteness.

dpnp.isnat

Test element-wise for NaT (not a time) and return result as a boolean array.

Examples

>>> import dpnp as np
>>> x = np.array([np.inf, 0., np.nan])
>>> np.isnan(x)
array([False, False,  True])