title: conditional operation on numpy multidimensional array
body: <p>I am a naive numpy user, need your help for the following problem: I want to replace some elements of a multidimensional array which are less than a second array by a third array; e.g.:</p>
  
  <pre><code>x = np.arange(16).reshape((2, 8)) 
  # x = np.array([[ 0,  1,  2,  3,  4,  5,  6,  7],
  #               [ 8,  9, 10, 11, 12, 13, 14, 15]])
  </code></pre>
  
  <p>And</p>
  
  <pre><code>y = np.array([[2], [13]])
  # y = np.array([[ 2], [13]])
  </code></pre>
  
  <p>Now, find out where <code>x</code> is greater than <code>y</code>, and if there is at least one <code>True</code> in <code>x &gt; y</code> array, count these instances, create another array (<code>z</code>) and replace <code>x</code> in these elements with <code>z</code>:</p>
  
  <pre><code>x &gt; y 
  # = [[False, False, False, True,  True,  True,  True, True],
  #    [False, False, False, False, False, False, True, True]]
  </code></pre>
  
  <p>In this case 5 elements of <code>x</code> (<code>x[:,3:]</code>) should be replaced, so we create a <code>(5, 2)</code> array:</p>
  
  <pre><code>z = np.array([[20,21],[22,23],[24,25],[26,27],[28,29]])
  </code></pre>
  
  <p>The result I want is</p>
  
  <pre><code>x == np.array([[ 0,  1,  2, 20, 22, 24, 26, 28],
                 [ 8,  9, 10, 21, 23, 25, 27, 29]])
  </code></pre>