[ Web Proxy ]
URL:
Viewing: https://numpy.org/doc/stable/reference/generated/../c-api/../generated/numpy.iscomplexobj.html [Back]  [Original]

numpy.iscomplexobj — NumPy v2.5 Manual
Back to top
Search the docs ...:

numpy.iscomplexobj#

numpy.iscomplexobj(x)[source]#

Check for a complex type or an array of complex numbers.

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

Parameters:
xany

The input can be of any type and shape.

Returns:
iscomplexobjbool

The return value, True if x is of a complex type or has at least one complex element.

See also

isrealobj, iscomplex

Examples

Try it in your browser!
>>> import numpy as np
>>> np.iscomplexobj(1)
False
>>> np.iscomplexobj(1+0j)
True
>>> np.iscomplexobj([3, 1+0j, True])
True

Web Proxy Viewer  |  New URL  |  Original Page