image_output_1.png
import pandas as pd

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

categorical = train.dtypes[train.dtypes == 'object'].index

train.isnull().sum()

train[['Pclass', 'Survived']].groupby(['Pclass']).mean().sort_values(by='Survived', ascending=False)