rougier/numpy-100

About No.25

martin-lee07 opened this issue · 4 comments

Given a 1D array, negate all elements which are between 3 and 8, in place

the code is
Z[(3 < Z) & (Z <= 8)] *= -1

and according to the title that "### between 3 and 8, in place",shouldn't it is
Z[(3 < Z) & (Z < 8)] *= -1? without = because between 3 and 8 is 4,5,6,7 these four elements?

You're right, I should have said 3 and 8 excluded and use your proposed fix. Can you make a PR?

Hi, can I help you with this?

Let's see if @martin-lee07 want to make the PR first.

@rougier Can I make PR for this?