text_plain_output_1.png
import numpy as np

import pandas as pd

titanic_df = pd.read_csv('../input/train.csv', dtype={'Age': np.float64})

titanic_df.groupby('Pclass').mean()

class_sex_grouping = titanic_df.groupby(['Pclass', 'Sex']).mean()

group_by_age = pd.cut(titanic_df['Age'], np.arange(0, 90, 10))
age_grouping = titanic_df.groupby(group_by_age).mean()
age_grouping['Survived'].plot.bar()