text_plain_output_2.png application_vnd.jupyter.stderr_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train = pd.read_csv('../input/titanic/train.csv')
test = pd.read_csv('../input/titanic/test.csv')

test = test.drop(['Pclass', 'Name', 'Cabin'], axis='columns')

test.isnull().sum()

test.loc[test.Sex == 'female', 'Sex'] = 1
test.loc[test.Sex == 'male', 'Sex'] = 0
test['Sex'] = test['Sex'].astype(float)

test.loc[test.Embarked == 'S', 'Embarked'] = 3
test.loc[test.Embarked == 'C', 'Embarked'] = 2
test.loc[test.Embarked == 'Q', 'Embarked'] = 1
test['Embarked'] = test['Embarked'].astype(float)

test.isnull().sum()

test.head()