dpnp.iscomplex
- dpnp.iscomplex(x)[source]
Returns a bool array, where
True
if input element is complex.What is tested is whether the input has a non-zero imaginary part, not if the input type is complex.
For full documentation refer to
numpy.iscomplex
.- Parameters:
x ({dpnp.ndarray, usm_ndarray}) -- Input array.
- Returns:
out -- Output array.
- Return type:
dpnp.ndarray
See also
dpnp.isreal
Returns a bool array, where
True
if input element is real.dpnp.iscomplexobj
Return
True
if x is a complex type or an array of complex numbers.
Examples
>>> import dpnp as np >>> a = np.array([1+1j, 1+0j, 4.5, 3, 2, 2j]) >>> np.iscomplex(a) array([ True, False, False, False, False, True])