Home > Enterprise >  Reading 3D numpy array
Reading 3D numpy array

Time:03-20

I have a dataset which comprises of the binary data of pixelated 50x50 images. The array shape is (50, 50, 90245). I want to reach 50x50 pixels of each of the 90245 images. How can I slice the array?

CodePudding user response:

If data is the variable storing the image data, and i is the index of the image you want to access, then you can do:

data[:,:,i]

to get the desired image data.

  • Related