numpy.iscomplexobj

numpy.iscomplexobj(x)

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

The type of the input is checked, not the value. So even if the input has an imaginary part equal to zero, iscomplexobj evaluates to True if the data type is complex.

Parameters :

x : any

The input can be of any type and shape.

Returns :

y : bool

The return value, True if x is of a complex type.

See also

isrealobj, iscomplex

Examples

>>> np.iscomplexobj(1)
False
>>> np.iscomplexobj(1+0j)
True
>>> np.iscomplexobj([3, 1+0j, True])
True

Previous topic

numpy.iscomplex

Next topic

numpy.isfortran

This Page