title: Need to convert 3d array to 2d with mean of inner array
body: <p>I am receiving a output like the below:</p>
  
  <pre><code>y = [[[1,1,1,1,1,1,1] ,[2,2,2,2,2,2,2], [3,3,3,3,3,3,3]],[[4,4,4],[5, 5, 5],[6, 6, 6]]]
  </code></pre>
  
  <p>the final output should be as below:</p>
  
  <pre><code>Y = [[1, 2, 3], [4, 5, 6]]
  </code></pre>
  
  <p>How to convert y to Y? [Here, the mean of the innermost array (or optionally any element) need to be used as a basic element and the final array (Y) need to be 2D, whereas the pre-final array (y) is 3D.</p>
  
  <p>(I am new to numpy/python, so this question my look stupid, if any other information is needed, please let me know)</p>