I have a (30000, 25, 25) dimension hdf file and have already converted it into a numpy array with the code below:
import numpy as np
import h5py
hf = h5py.File('data.h5', 'r')
n1 = np.array(hf["image"][:])
x = n1[0:625:30000]
print(x)
In hdfview, after changing its dimensions, I was able to create 30000 individual 25 X 25 arrays. However, with the code above, I am only able to open the first array. The code below is able to show the first array:
import numpy as np
import h5py
hf = h5py.File('data.h5', 'r')
n1 = np.array(hf["image"][:])
x[0] = n1[0:625:30000]
print(x)
When I change x[0]
to x[1]
or anything higher it says - "index 1 is out of bounds for axis 0 with size 1." Is there a solution to output 30000 of these 25 X 25 arrays demonstrated in hdfview?