text_plain_output_1.png
from sklearn.model_selection import train_test_split

import numpy as np # linear algebra

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

from sklearn.model_selection import train_test_split
seed = 5
np.random.seed(seed)
data_train = pd.read_csv('../input/train.csv')
X = data_train.drop('label', axis=1)
y = data_train['label']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1, random_state=seed)

X_train_matrix = X_train_matrix.astype('float32') / 255
X_test_matrix = X_test_matrix.astype('float32') / 255

X_train = np.array(list(map(lambda x: np.reshape(x, (28, 28, 1)), X_train_matrix)))
X_test = np.array(list(map(lambda x: np.reshape(x, (28, 28, 1)), X_test_matrix)))

data_test = pd.read_csv('../input/test.csv')

test = np.array(list(map(lambda x: np.reshape(x, (28, 28, 1)), data_test.as_matrix())))
test.shape