The imaginary part of the masked array. This property is a view on the imaginary part of this `MaskedArray`. See Also -------- real Examples -------- >>> import numpy as np >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[
(self)
| 4537 | |
| 4538 | @property |
| 4539 | def imag(self): |
| 4540 | """ |
| 4541 | The imaginary part of the masked array. |
| 4542 | |
| 4543 | This property is a view on the imaginary part of this `MaskedArray`. |
| 4544 | |
| 4545 | See Also |
| 4546 | -------- |
| 4547 | real |
| 4548 | |
| 4549 | Examples |
| 4550 | -------- |
| 4551 | >>> import numpy as np |
| 4552 | >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False]) |
| 4553 | >>> x.imag |
| 4554 | masked_array(data=[1.0, --, 1.6], |
| 4555 | mask=[False, True, False], |
| 4556 | fill_value=1e+20) |
| 4557 | |
| 4558 | """ |
| 4559 | result = self._data.imag.view(type(self)) |
| 4560 | result.__setmask__(self._mask) |
| 4561 | return result |
| 4562 | |
| 4563 | # kept for compatibility |
| 4564 | get_imag = imag.fget |