text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train = pd.read_csv('../input/fashion-mnist_train.csv')

train.shape

test = pd.read_csv('../input/fashion-mnist_test.csv')

test.shape

class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']

train_images = train.iloc[:, 1:785]
train_labels = train.iloc[:, 0]
test_images = test.iloc[:, 1:785]
test_labels = test.iloc[:, 0]

plt.colorbar()
plt.xticks([])
plt.yticks([])

plt.colorbar()
plt.xticks([])
plt.yticks([])

train_images = train_images / 255.0
test_images = test_images / 255.0

plt.figure(figsize=(10, 10))
for i in range(25):
    plt.subplot(5, 5, i + 1)
    plt.xticks([])
    plt.yticks([])
    plt.grid(False)
    plt.imshow(train_images.iloc[i].as_matrix().reshape(28, 28))
    plt.xlabel(class_names[train_labels[i]])
plt.show()