I have a list containing numpy arrays of identical 2D shape I wanna pack those images for a ConvNet Classifier and I tried two approaches as shown below :
X_train = np.array(lst_imgs).reshape(m, 24, 40, 1)/255
XX_train = np.stack((lst_imgs), -1).reshape(m, 24, 40, 1)/255
both tensors yield shape of : (4828, 24, 40, 1)
However they don't contain the same elements at each index. Can someone please explain to me what is the difference between np.array and np.stack for this purpose and which one is the most suitable ?
Thank you very much !