title: Manipulate array values in an easy way
body: <p>From a previous post, I learned how to change all values in a 2D-Array in a very fast and easy way:</p>
  
  <p>e.g. set all values smaller than 255 to x:</p>
  
  <p><code>arr[arr &lt; 255] = x</code></p>
  
  <p>Now I want to do something similar, but not just setting the value to x.</p>
  
  <p>I want to manipulate the value in this array in a specific way when it's below a treshold.</p>
  
  <p><code>arr[abs(arr) &lt; threshold] = arr(*where condition is true*) - threshold*x</code></p>
  
  <p>arr - theshold*x does not work, since arr is the complete array.</p>
  
  <p>I think that a loop with <code>np.where</code> is needed to solve this problem which isn't quite easy as before. Is there any better way?</p>