dpnp.isfinite

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

Test if each element of input array is a finite number.

For full documentation refer to numpy.isfinite.

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

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

  • 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 not positive infinity, negative infinity, or 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.isnan

Test element-wise for NaN and return result as a boolean array.

Notes

Not a Number, positive infinity and negative infinity are considered to be non-finite.

Examples

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