Efficient implementation of aggregating test/train data Here is a short python snippet to ingest train data:

x_train = []
y_train = []

for x,y in train:
    x_train.append(x)
    y_train.append(y)

x_train = np.asarray(x_train)
y_train = np.asarray(y_train)


The variable train is a list of 60000 (x,y) tuples.
How about:

x_train, y_train = np.hsplit(np.asarray(train), 2)


Which uses only numpy functions and should be a bit faster than your implementation using intermediate lists.