title: Vectorization on nested loop
body: <p>I need to vectorize the following program : </p>
  
  <pre><code>y = np.empty((100, 100, 3))  
  x = np.empty((300,)) 
  for i in xrange(y.shape[0]):
      for j in xrange(y.shape[1]):
          y[i, j, 0] = x[y[i, j, 0]]
  </code></pre>
  
  <p>Of course, in my example, we suppose that y[:, :, :]&lt;=299
  Vectorization, as far as I know, can't simply work here as we are using the native python indexing on lists ...</p>
  
  <p>I've heard of <code>np.apply_along_axis</code>, but it doesn't work on this special case, or may I missed something ?</p>
  
  <p>Thank you very much for any help.</p>