[Numpy-discussion] simple slicing question

Keith Goodman kwgoodman@gmail....
Wed Aug 8 05:53:07 CDT 2007


On 8/8/07, mark <markbak@gmail.com> 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


More information about the Numpy-discussion mailing list