title: 3d array access in numpy
body: <p>I have NxMx3 numpy array and want to get access to subarrays of size 3. For example I want instead of</p>
  
  <pre><code>arr = [[[...]]]
  for i in range(N):
      for j in range(M):
          b = do_something(arr[i][j])
  </code></pre>
  
  <p>write</p>
  
  <pre><code>map(lambda x: do_something(x), ???) # x - is array of size 3
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p>The function <code>do_something</code> takes arrays of size 3 and returns a scalar, and I want to get the array of the results by applying the function to each length-3 subarray of my input.</p>