title: Copy values from numpy array to another array depending on a third value
body: <p>im using numpy 2d arrays. I want to copy values from one array to another array, but only if an expression is true.</p>
  
  <p>e.g.</p>
  
  <pre><code>for row in range(len(anImage1)):
    for col in range(len(anImage1[0])):
      if col &gt; 100:
        anImage1[row][col] = min(anImage1[row][col], anImage2[row][col])
  </code></pre>
  
  <p>or</p>
  
  <pre><code>for row in range(len(anImage1)):
    for col in range(len(anImage1[0])):
      if anImageMask[row][col] == 255:
        anImage1[row][col] = anImage2[row][col]
  </code></pre>
  
  <p>I know this is a very poor and slow solution... Can somebody explain me how to speed up the code?</p>