numpy.iscomplexobj#
- numpy.iscomplexobj(x)[原始碼]#
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,
iscomplexobjevaluates to True.- 參數:
- xany
The input can be of any type and shape.
- 回傳值:
- iscomplexobjbool
The return value, True if x is of a complex type or has at least one complex element.
範例
>>> import numpy as np >>> np.iscomplexobj(1) False >>> np.iscomplexobj(1+0j) True >>> np.iscomplexobj([3, 1+0j, True]) True