[Numpy-discussion] Question on numpy.ma.masked_values

Gökhan Sever gokhansever@gmail....
Thu Mar 15 14:06:48 CDT 2012


On Thu, Mar 15, 2012 at 12:56 PM, Gökhan Sever <gokhansever@gmail.com>wrote:

If not so, how can I return a set of False values if my masking condition
> is not met?
>

Self-answer: I can force the mask to be filled with False's, however unsure
if this is a safe operation.

I50 x = np.array([1, 1.1, 2, 1.1, 3])

I51 y = np.ma.masked_values(x, 1.5, shrink=0)

I52 y
O52
masked_array(data = [1.0 1.1 2.0 1.1 3.0],
             mask = False,
       fill_value = 1.5)


I53 y.mask = np.zeros(len(x), dtype=np.bool)*True

I54 y
O54
masked_array(data = [1.0 1.1 2.0 1.1 3.0],
             mask = [False False False False False],
       fill_value = 1.5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120315/bbf7201a/attachment.html 


More information about the NumPy-Discussion mailing list