'Can't access dimension z of a 3d numpy array

I have a 3d image stored in fet_img np array. The size is (400,400,74).

I want to access the 74 2D images seperately, each of size (400,400).

I would expect that this would do the trick:

fet_img[:][:][0] 

However, when I print the shape of this, I get (400,74)

I tried

fet_img[0][:][:] 

and

fet_img[:][0][:] 

but the size of all three of these are (400,74)... I'm overlooking something but I can't quite figure out what?

Note: I'm runnning this from a local jupyter notebook and all values are dtype('float64') if that matters at all.



Solution 1:[1]

You should use fet_img[:, :, 0] instead.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dilara Gokay