bundles / numpy latest / numpy / imag
_ArrayFunctionDispatcher
numpy:imag
source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/lib/_type_check_impl.py :131
Signature
def imag ( val ) Summary
Return the imaginary part of the complex argument.
Parameters
val: array_likeInput array.
Returns
out: ndarray or scalarThe imaginary component of the complex argument. If
valis real, the type ofvalis used for the output. Ifvalhas complex elements, the returned type is float.
Examples
import numpy as np a = np.array([1+2j, 3+4j, 5+6j])✓
a.imag
✗a.imag = np.array([8, 10, 12])
✓a
✗np.imag(1 + 1j)
✓See also
- angle
- real
- real_if_close
Aliases
-
numpy.imag