xarray.ufuncs.iscomplex

Contents

xarray.ufuncs.iscomplex#

xarray.ufuncs.iscomplex = <xarray.ufuncs._unary_ufunc object>#

xarray specific variant of numpy.iscomplex(). Handles xarray objects by dispatching to the appropriate function for the underlying array type.

Documentation from numpy:

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.

Parameters

x (array_like) – Input array.

Returns

out (ndarray of bools) – Output array.

See also

isreal

iscomplexobj

Return True if x is a complex type or an array of complex numbers.

Examples

>>> np.iscomplex([1+1j, 1+0j, 4.5, 3, 2, 2j])
array([ True, False, False, False, False,  True])