title: numpy: iterate over nested array
body: <p>Im trying to iterate over a nested (numpy) array using np.nditer().</p>
  
  <p>Converted a nested list of ints to a nested numpy array.</p>
  
  <pre><code>from numpy import mean, array, nditer
  
  nested_list = [[1,2,3],[2,3,4],[3,4,5],[4,5,6]]
  
  np_array = []
  for i in nested_list:
      a = array(nested_list)
  np_array.append(a)
  </code></pre>
  
  <p>The above works, yielding;</p>
  
  <pre><code>[array([[1,2,3],
         [2,3,4],
         [3,4,5],
         [4,5,6]])]
  </code></pre>
  
  <p>I want to calculate the mean of each nested sub-list... I have tried this but it's not working correctly.</p>
  
  <pre><code>np_mean = []
  c = 0
  for i in nditer(np_array):
      m = mean(i)
      np_mean_rep.append(m)
      c += 1
  print np_mean_rep
  </code></pre>
  
  <p>...this kinda flattens the nested array so i doesn't point to each nested sub-list but instead to each value. How would I use nditer in a way so this would work? Any pointer would be greatly appreciated!</p>