MCPcopy Create free account
hub / github.com/numpy/numpy / imag

Method imag

numpy/ma/core.py:4472–4493  ·  view source on GitHub ↗

The imaginary part of the masked array. This property is a view on the imaginary part of this `MaskedArray`. See Also -------- real Examples -------- >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False]) >>

(self)

Source from the content-addressed store, hash-verified

4470
4471 @property
4472 def imag(self):
4473 """
4474 The imaginary part of the masked array.
4475
4476 This property is a view on the imaginary part of this `MaskedArray`.
4477
4478 See Also
4479 --------
4480 real
4481
4482 Examples
4483 --------
4484 >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
4485 >>> x.imag
4486 masked_array(data=[1.0, --, 1.6],
4487 mask=[False, True, False],
4488 fill_value=1e+20)
4489
4490 """
4491 result = self._data.imag.view(type(self))
4492 result.__setmask__(self._mask)
4493 return result
4494
4495 # kept for compatibility
4496 get_imag = imag.fget

Callers 3

test_realMethod · 0.80
test_cmplxMethod · 0.80
imagFunction · 0.80

Calls 2

__setmask__Method · 0.80
viewMethod · 0.45

Tested by 2

test_realMethod · 0.64
test_cmplxMethod · 0.64