application_vnd.jupyter.stderr_output_1.png
from sklearn.model_selection import train_test_split

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

data_train = pd.read_csv('train.csv')
data_test = pd.read_csv('test.csv')

data_x = data_train[['Pclass', 'Age', 'Sex']]
data_y = data_train['Survived']
age_mean = data_x.mean()['Age']
data_x = data_x.fillna(age_mean)
for i in range(1, 4):
    data_x.loc[data_x.Pclass == i, 'Pclass'] = str(i)

from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(data_x, data_y, test_size=0.25, random_state=33)
y_train.value_counts()