i have 3 numpy arrays which store image data of shape (4,100,100).
arr1= np.load(r'C:\Users\x\Desktop\py\output\a1.npy')
arr2= np.load(r'C:\Users\x\Desktop\py\output\a2.npy')
arr3= np.load(r'C:\Users\x\Desktop\py\output\a3.npy')
I want to merge all 3 arrays into 1 array. I have tried in this way:
merg_arr = np.zeros((len(arr1)+len(arr2)+len(arr3), 4,100,100), dtype=input_img.dtype)
now this make an array of the required length but I don't know how to copy all the data in this array. may be using a loop?
(len(arr1)+len(arr2)+len(arr3), 4, ...part. Can you explaian why you want a shape of [12, 4, 100, 100]? Either [3, 4, 100, 100] or [12, 100, 100] would seem to make more sense.vstack. Here the arrays have the right shape to concatenate on the 1st dimension. It's evident from the comments that the problem isn't with concatenate. Something else is going on.