[ Web Proxy ]
URL:
Viewing: https://numpy.org/doc/stable/reference/generated/numpy.ndarray.imag.html [Back]  [Original]

numpy.ndarray.imag — NumPy v2.5 Manual
Back to top
Search the docs ...:

numpy.ndarray.imag#

attribute

ndarray.imag#

The imaginary part of the array.

Returns a view into the original array for complex arrays. For non-complex arrays, returns a zero array of the same dtype. For object arrays returns elementwise .imag or 0 if .imag is undefined.

Examples

Try it in your browser!
>>> import numpy as np
>>> x = np.sqrt([1+0j, 0+1j])
>>> x.imag
array([ 0.        ,  0.70710678])
>>> x.imag.dtype
dtype('float64')

Web Proxy Viewer  |  New URL  |  Original Page