SciPy

numpy.ma.masked_array.get_real

method

masked_array.get_real()[source]

Return the real part of the masked array.

The returned array is a view on the real part of the MaskedArray whose get_real method is called.

Parameters:
None
Returns:
result : MaskedArray

The real part of the masked array.

See also

get_imag, real, imag

Examples

>>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
>>> x.get_real()
masked_array(data = [1.0 -- 3.45],
             mask = [False  True False],
       fill_value = 1e+20)