title: Looping over 1st dimension of 3D numpy array to create a smaller 3D array, via slicing
body: <p>this is my first post so apologies if the formatting isn't quite right. I am writing some code for my masters dissertation, in which I am am studying satellite images of sea ice near the Alaskan coast. The satellite instrument I am using has 9 cameras, so for each image/band I have 9 subdatasets, which I am trying to loop over: NIR_data is a 3D numpy array, with the following dimensions: 9,512,256. I am trying to create a new 3D array, which is a 10x10 subset of the original array, defined by the pixel coordinates [256:266,112:122]. So if I was just doing it for 1 file the code would be:</p>
  
  <pre><code>NIR_BRF = NIR_data[i][256:266,112:122]
  </code></pre>
  
  <p>So, trying to loop over the first dimension of my NIR_data array, this is the closest I am getting:</p>
  
  <pre><code>for i,f in enumerate(NIR_data):
      NIR_BRF[i] = NIR_data[i][256:266,112:122]
  </code></pre>
  
  <p>where NIR_BRF is a predefined, empty array measuring 9,10,10. The result is a 9,10,10 array, however all the values in this array are identical, i.e. the loop hasn't worked.
  I hope I've explained this well enough, I know this shouldn't be too difficult, but I'm struggling to get my brain working properly.</p>
  
  <p>Many thanks</p>
  
  <p>Alex</p>