text_plain_output_1.png image_output_1.png
import pandas as pd

titanic_train = pd.read_csv('../input/train.csv', index_col='PassengerId')
titanic_test = pd.read_csv('../input/test.csv', index_col='PassengerId')

combined = pd.concat((titanic_train, titanic_test), axis=0)

ages_mean = combined.pivot_table('Age', index=['Title'], columns=['Sex', 'Pclass'], aggfunc='mean')
ages_mean

ages_std = combined.pivot_table('Age', index=['Title'], columns=['Sex', 'Pclass'], aggfunc='std')
ages_std