MCPcopy Index your code
hub / github.com/numpy/numpy / real

Method real

numpy/ma/core.py:4567–4589  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

4565
4566 @property
4567 def real(self):
4568 """
4569 The real part of the masked array.
4570
4571 This property is a view on the real part of this `MaskedArray`.
4572
4573 See Also
4574 --------
4575 imag
4576
4577 Examples
4578 --------
4579 >>> import numpy as np
4580 >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
4581 >>> x.real
4582 masked_array(data=[1.0, --, 3.45],
4583 mask=[False, True, False],
4584 fill_value=1e+20)
4585
4586 """
4587 result = self._data.real.view(type(self))
4588 result.__setmask__(self._mask)
4589 return result
4590
4591 # kept for compatibility
4592 get_real = real.fget

Callers 3

test_fabsMethod · 0.80
test_realMethod · 0.80
test_cmplxMethod · 0.80

Calls 2

__setmask__Method · 0.80
viewMethod · 0.45

Tested by 3

test_fabsMethod · 0.64
test_realMethod · 0.64
test_cmplxMethod · 0.64