I have 60000 train_images brought in as a shape (28,28,60000) matrix. It is a numpy.ndarray. I want to convert it to an array of 1 dimensional images, meaning each image is
You can reshape train_images
and verify it by plotting the images,
Reshaping:
train_features_images = train_images.reshape(train_images.shape[0],28,28)
Plotting images:
import matplotlib.pyplot as plt
def show_images(features_images,labels,start, howmany):
for i in range(start, start+howmany):
plt.figure(i)
plt.imshow(features_images[i], cmap=plt.get_cmap('gray'))
plt.title(labels[i])
plt.show()
show_images(train_features_images, labels, 1, 10)