__complex__¶
- array.__complex__() complex ¶
Converts a zero-dimensional array to a Python
complex
object.- Parameters:
self (array) – zero-dimensional array instance.
- Returns:
out (complex) – a Python
complex
object representing the single element of the array instance.
Notes
Special cases
For boolean operands,
If
self
isTrue
, the result is1+0j
.If
self
isFalse
, the result is0+0j
.
For real-valued floating-point operands,
If
self
isNaN
, the result isNaN + NaN j
.If
self
is+infinity
, the result is+infinity + 0j
.If
self
is-infinity
, the result is-infinity + 0j
.If
self
is a finite number, the result isself + 0j
.
New in version 2022.12.