thank you, that makes sense.<br> I should have posted this on another list (which I have now). and the change required is:<br><br>If your new array is x, you can use:<br><br>numpy.ma.masked_array(x, mask=mask.mask)<br><br>
<div class="gmail_quote">On Tue, Nov 22, 2011 at 11:48 AM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On 21/11/2011 21:42, questions anon wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am trying to mask one array using another array.<br>
<br>
I have created a masked array using<br>
mask=MA.masked_equal(myarray,<u></u>0),<br>
that looks something like:<br>
[1 - - 1,<br>
1 1 - 1,<br>
1 1 1 1,<br>
- 1 - 1]<br>
<br>
I have an array of values that I want to mask whereever my mask has a a '-'.<br>
how do I do this?<br>
I have looked at<br>
<a href="http://www.cawcr.gov.au/bmrc/climdyn/staff/lih/pubs/docs/masks.pdf" target="_blank">http://www.cawcr.gov.au/bmrc/<u></u>climdyn/staff/lih/pubs/docs/<u></u>masks.pdf</a> but<br>
the command:<br>
<br>
d = array(a, mask=c.mask()<br>
<br>
results in this error:<br>
TypeError: 'numpy.ndarray' object is not callable<br>
<br>
I basically want to do exactly what that article does in that equation.<br>
<br>
Any feedback will be greatly appreciated.<br>
<br>
</blockquote></div></div>
The article is using the Numeric module, but your error says that you're using<br>
the numpy module. They're not the same.<br><font color="#888888">
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>