I have 5 numpy arrays with shape (5,5). What I want to achieve is to combine these 5 numpy arrays to one array of shape (5,5,5). My code looks like the following but does not work:
combined = np.empty((0, 5, 5), dtype=np.uint8)
for idx in range(0, 5):
array = getarray(idx) # returns an array of shape (5,5)
np.append(combined, img, axis=0)
I thought if I set the first axis to 0 it will append on this axis so that in the end the shape will be (5,5,5). What is wrong here?