Re: [Numpy-discussion] simple slicing question

2007-08-08 Thread mark
Life is so simple. Thanks Keith, Mark On Aug 8, 12:53 pm, "Keith Goodman" <[EMAIL PROTECTED]> wrote: > On 8/8/07, mark <[EMAIL PROTECTED]> wrote: > > > But what if I want to multiply every value between -5 and +5 by 100. > > This does NOT work: > > > d[ d>-5 and d<5 ] *= 100 > > d[(d>-5) & (d<5)]

Re: [Numpy-discussion] simple slicing question

2007-08-08 Thread Keith Goodman
On 8/8/07, mark <[EMAIL PROTECTED]> wrote: > But what if I want to multiply every value between -5 and +5 by 100. > This does NOT work: > > d[ d>-5 and d<5 ] *= 100 d[(d>-5) & (d<5)] *= 100 ___ Numpy-discussion mailing list Numpy-discussion@scipy.org ht

[Numpy-discussion] simple slicing question

2007-08-08 Thread mark
Consider the array d: d = linspace( -10, 10, 10 ) If I want to multiply every value above -5 by 100 I can do d[ d>-5 ] *= 100 But what if I want to multiply every value between -5 and +5 by 100. This does NOT work: d[ d>-5 and d<5 ] *= 100 Any ideas? Thanks, Mark ___