title: Conversion of multi-dimension array to 2d and subsequent indexing
body: <p>I have some code which logically is best setup as heavily nested arrays. 
  The overall structure is of high dimensions and sparse so I've had to convert it to a 2d matrix as required by the sparse implementation so it will fit in memory. </p>
  
  <p>I now find myself mentally switching between the 2 formats which is complicated and confusing. I've written a little function which from the nested inputs will calculate the 2d cell but if i want to do a range query it will get much more complicated. </p>
  
  <pre><code>import numpy as np
  
  dim1 = 1
  dim2 = 2
  dim3 = 3
  dim4 = 4 
  dim5 = 5
  dim6 = 6
  
  sixD = np.arange(720).reshape(dim1, dim2, dim3, dim4, dim5, dim6)
  
  twoD = sixD.transpose(0,1,2,3,4,5).reshape(dim1,-1)
  
  def sixDto2DCell(a, b, c, d, e, f):
    return [a, (b*dim3*dim4*dim5*dim6) + 
      (c*dim4*dim5*dim6) + 
      (d*dim5*dim6) + 
      (e*dim6) + 
      f]
  
  x, y = sixDto2DCell(0, 1, 2, 3, 4, 5)
  assert(sixD[0, 1, 2, 3, 4, 5] == twoD[x, y])
  </code></pre>
  
  <p>so I'm trying to work out what I'd do for a query like</p>
  
  <pre><code>sixD[0, 1, 0:, 3, 4, 5]
  </code></pre>
  
  <p>to return the same values in the 2d matrix</p>
  
  <p>Will I need to write a new function or have I missed a built-in numpy way of achieving the same thing ?</p>
  
  <p>Any help would be greatly appreciated :-)</p>