bundles / numpy latest / numpy / real
_ArrayFunctionDispatcher
numpy:real
source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/lib/_type_check_impl.py :84
Signature
def real ( val ) Summary
Return the real part of the complex argument.
Parameters
val: array_likeInput array.
Returns
out: ndarray or scalarThe real 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.real
✗a.real = 9
✓a
✗a.real = np.array([9, 8, 7])
✓a
✗np.real(1 + 1j)
✓See also
- angle
- imag
- real_if_close
Aliases
-
numpy.real