text_plain_output_1.png
from sklearn.preprocessing import LabelEncoder

import numpy as np # linear algebra

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

data = pd.read_csv('../input/mushrooms.csv')

from sklearn.preprocessing import LabelEncoder
labelencoder = LabelEncoder()
for col in data.columns:
    data[col] = labelencoder.fit_transform(data[col])

print(data.shape)
data = np.array(data)
_length = 8000
train, test = (data[0:_length,], data[_length:,])
Xtrain, ytrain = (train[:, 1:], train[:, 0])
Xtest, ytest = (test[:, 1:], test[:, 0])
print(Xtrain.shape)
print(ytrain.shape)
print(Xtest.shape)
print(ytest.shape)