[Numpy-discussion] Re: Numpy-discussion digest, Vol 1 #1632 - 10 msgs
bsouthey at gmail.com
Thu Mar 23 06:34:11 CST 2006
I think that there are different behaviors being obtained. One occurs
when a scalar value is used and another occurs when an array is being
used. In the first is it just an extension of masking the whole array
twice with two different values. In the second case it seems more of
an element by element masking with two different values, which
requires creating min and max arrays. There is also a third case of a
single dimension so min and max vectors to operate on that dimension.
In anycase, the values should only be masked because it allows the
values to be unmasked as necessary. In which case there needs to be an
appropriate unmask function such that in the extreme one of limits
could be removed.
On 3/22/06, Pierre GM <pierregm at engr.uga.edu> wrote:
> > Pierre has implemented the clip method for ma.array, but his
> > implementation does not seem to do the right thing if min or max is
> > masked:
> From core/oldnumeric.py:
> """clip(m, m_min, m_max) = every entry in m that is less than m_min is
> replaced by m_min, and every entry greater than m_max is replaced by
> My understanding was that m_min and m_max were two floats, not two arrays. I
> completely oversaw that. Your suggestion (masking where the limits are
> masked) makes complete sense. I'll work on that.
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
More information about the Numpy-discussion