Travis Oliphant wrote:
>Yes, this does explain what you are seeing.It is the behavior of
>Numeric's putmask (where this method came from). It does seem
>counter-intuitive, and I'm not sure what to do with it. In some sense
>putmask should behave the same as x[m] = w. But, on the other-
Stefan,
Thanks for your suggestions, but that won't do for what I'm working on : I
need to get putmask working, or at least knowing it doesnt'.
Robert, thanks for your input. The function putmask doesn't work either.
Oh, thinking about it: would it be possible to have the same order of
arguments
Stefan van der Walt wrote:
> On Fri, Sep 22, 2006 at 02:17:57AM -0500, Robert Kern wrote:
>
>>> According to the putmask docstring:
>>>
>>> a.putmask(values, mask) sets a.flat[n] = v[n] for each n where
>>> mask.flat[n] is true. v can be scalar.
>>>
>>> This would mean that 'w' is not of
On Fri, Sep 22, 2006 at 02:17:57AM -0500, Robert Kern wrote:
> Stefan van der Walt wrote:
> > Hi P.,
> >
> > On Thu, Sep 21, 2006 at 07:40:39PM -0400, PGM wrote:
> >
> >> I'm running into the following problem with putmask on take.
> >>
> > import numpy
> > x = N.arange(12.)
> > m = [
Stefan van der Walt wrote:
> Hi P.,
>
> On Thu, Sep 21, 2006 at 07:40:39PM -0400, PGM wrote:
>
>> I'm running into the following problem with putmask on take.
>>
> import numpy
> x = N.arange(12.)
> m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1]
> i = N.nonzero(m)[0]
> w = N.array([
On Thu, Sep 21, 2006 at 08:35:02PM -0400, P GM wrote:
> Folks,
> I'm running into the following problem with putmask on take.
>
> >>> import numpy
> >>> x = N.arange(12.)
> >>> m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1]
> >>> i = N.nonzero (m)[0]
> >>> w = N.array([-1, -2, -3, -4.])
> >>> x.putmask(
Hi P.,
On Thu, Sep 21, 2006 at 07:40:39PM -0400, PGM wrote:
> I'm running into the following problem with putmask on take.
>
> >>> import numpy
> >>> x = N.arange(12.)
> >>> m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1]
> >>> i = N.nonzero(m)[0]
> >>> w = N.array([-1, -2, -3, -4.])
> >>> x.putmask(w,
Folks,
I'm running into the following problem with putmask on take.
>>> import numpy
>>> x = N.arange(12.)
>>> m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1]
>>> i = N.nonzero(m)[0]
>>> w = N.array([-1, -2, -3, -4.])
>>> x.putmask(w,m)
>>> x.take(i)
>>> N.allclose(x.take(i),w)
False
I'm wondering if
Folks,I'm running into the following problem with putmask on take. >>> import numpy>>> x = N.arange(12.)>>> m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1]>>> i = N.nonzero
(m)[0]>>> w = N.array([-1, -2, -3, -4.])>>> x.putmask(w,m)>>> x.take(i)>>> N.allclose(x.take(i),w)FalseI'm wondering ifit is intentio