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)
| 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 |