I have a NumPy array called FLAIR_X with 583 images. Each image can be extracted by using the index (e.g., plt.imshow(FLAIR_X[0])). Currently, the shape of the array is (583,), but sklearn needs an array of size (583, 224, 224) ((224,224)being the size of a single image). This will also make it easier to work with. I tried doing :
temp = FLAIR_X.reshape(583, 224, 224)
But I got the error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-108-4bb1899edbd8> in <module>
----> 1 temp = FLAIR_X.reshape(583, 224, 224)
ValueError: cannot reshape array of size 583 into shape (583,224,224)
How can I reshape this array, so that is meets the requirements?
P.S: Just an extra question, will I be able to display images like earlier (plt.imshow(FLAIR_X[0])) after I reshape the data?
Thanks,
image?(224, 224).