numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
real(val)

Parameters

val : array_like

Input array.

Returns

out : ndarray or scalar

The real component of the complex argument. If :None:None:`val` is real, the type of :None:None:`val` is used for the output. If :None:None:`val` has complex elements, the returned type is float.

Return the real part of the complex argument.

See Also

angle
imag
real_if_close

Examples

>>> a = np.array([1+2j, 3+4j, 5+6j])
... a.real array([1., 3., 5.])
>>> a.real = 9
... a array([9.+2.j, 9.+4.j, 9.+6.j])
>>> a.real = np.array([9, 8, 7])
... a array([9.+2.j, 8.+4.j, 7.+6.j])
>>> np.real(1 + 1j)
1.0
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.ma.core.MaskedArray.imag numpy.real_if_close numpy.imag

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/type_check.py#121
type: <class 'function'>
Commit: