Array API compatible wrapper for :py:func:`np.imag `. See its docstring for more information.
(x: Array, /)
| 379 | |
| 380 | |
| 381 | def imag(x: Array, /) -> Array: |
| 382 | """ |
| 383 | Array API compatible wrapper for :py:func:`np.imag <numpy.imag>`. |
| 384 | |
| 385 | See its docstring for more information. |
| 386 | """ |
| 387 | if x.dtype not in _complex_floating_dtypes: |
| 388 | raise TypeError("Only complex floating-point dtypes are allowed in imag") |
| 389 | return Array._new(np.imag(x)) |
| 390 | |
| 391 | |
| 392 | def isfinite(x: Array, /) -> Array: |