numpy.iscomplex

numpy.iscomplex(x)

Return a bool array, True if element is complex (non-zero imaginary part).

For scalars, return a boolean.

Parameters:

x : array_like

Input array.

Returns:

out : ndarray, bool

Output array.

Examples

>>> x = np.array([1,2,3.j])
>>> np.iscomplex(x)
array([False, False,  True], dtype=bool)

Previous topic

numpy.isposinf

Next topic

numpy.iscomplexobj

This Page

Quick search