text_plain_output_1.png
import matplotlib.pyplot as plt
import matplotlib.cm as cm
X_train_matrix = X_train.as_matrix()
y_train_matrix = y_train.as_matrix()
X_test_matrix = X_test.as_matrix()
y_test_matrix = y_test.as_matrix()
fig = plt.figure(figsize=(20, 20))
for i in range(10):
    axis = fig.add_subplot(1, 10, i + 1, xticks=[], yticks=[])
    axis.imshow(np.reshape(X_train_matrix[i], (28, 28)), cmap='gray')
    axis.set_title(str(y_train_matrix[i]))