[Numpy-discussion] simple slicing question

Keith Goodman kwgoodman at gmail.com
Wed Aug 8 06:53:07 EDT 2007


On 8/8/07, mark <markbak at 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