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

Method real

numpy/ma/core.py:4499–4520  ·  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 -------- >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False]) >>> x.real

(self)

Source from the content-addressed store, hash-verified

4497
4498 @property
4499 def real(self):
4500 """
4501 The real part of the masked array.
4502
4503 This property is a view on the real part of this `MaskedArray`.
4504
4505 See Also
4506 --------
4507 imag
4508
4509 Examples
4510 --------
4511 >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
4512 >>> x.real
4513 masked_array(data=[1.0, --, 3.45],
4514 mask=[False, True, False],
4515 fill_value=1e+20)
4516
4517 """
4518 result = self._data.real.view(type(self))
4519 result.__setmask__(self._mask)
4520 return result
4521
4522 # kept for compatibility
4523 get_real = real.fget

Callers 4

test_fabsMethod · 0.80
test_realMethod · 0.80
test_cmplxMethod · 0.80
realFunction · 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