Rearange image vector
[handwriting-recognition.git] / read_display_mnist.py
index fd85ee3887941fee01f3cd1259ea7b5a6dac55a5..3030a0b50cc7b19142d6c1ca9b570e6c706e96b7 100755 (executable)
@@ -10,5 +10,5 @@ train_images, train_labels, rows, cols = mnist.load('train-images-idx3-ubyte', '
 # show the first bunch of training data
 for i in range(10):
     print(f'train image #{i}: label {train_labels[i]}')
-    plt.imshow(train_images[i].reshape(rows, cols), cmap='gray')
+    plt.imshow(train_images[:, i].reshape(rows, cols), cmap='gray')
     plt.show()