dpnp.isreal

dpnp.isreal(x)[source]

Returns a bool array, where True if input element is real.

If element has complex type with zero imaginary part, the return value for that element is True.

For full documentation refer to numpy.isreal.

Parameters:

x ({dpnp.ndarray, usm_ndarray}) -- Input array.

Returns:

out -- Boolean array of same shape as x.

Return type:

: dpnp.ndarray

See also

dpnp.iscomplex

Returns a bool array, where True if input element is complex.

dpnp.isrealobj

Return True if x is not a complex type.

Examples

>>> import dpnp as np
>>> a = np.array([1+1j, 1+0j, 4.5, 3, 2, 2j])
>>> np.isreal(a)
array([False,  True,  True,  True,  True, False])