title: numpy.subtract but only until difference reaches threshold - replace numbers smaller than that with threshold
body: <p>I want to subtract a given value from each element in my <code>numpy</code> array.
  For example, if I have a numpy array called <code>a_q</code>, and variable called <code>subtract_me</code>, then I can simply do this:</p>
  
  <pre><code>result = np.subtract(a_q,subtract_me)
  </code></pre>
  
  <p>That's fine. But I don't want it to simply subtract blindly from every element. If the difference is lower than a threshold, then I don't want the subtraction to happen. Instead, I want that element of the array to be replaced by that threshold.</p>
  
  <p>What's the most efficient way to do this? I could simply iterate through the array and subtract from each element and put a check condition on whether the threshold has been reached or not, and build a new array out of the results (as below) - but is there a better or more efficient way to do it?</p>
  
  <pre><code>threshold = 3 # in my real program, the threshold is the 
                # lowest non-infinity number that python can handle
  subtract_me = 6
  a_q = []
  for i in range(10):
      val = i - subtract_me
      if val &lt; threshold:
          val = threshold
      a_q.append(val)
  
  myarr = np.array(a_q)
  print myarr
  </code></pre>