text_plain_output_1.png image_output_1.png
from pandas import Series, DataFrame

import pandas as pd

import seaborn as sns

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

fig = sns.FacetGrid(titanic, hue='Sex', aspect=4)
fig.map(sns.kdeplot, 'Age', shade=True)
oldest = titanic['Age'].max()
fig.set(xlim=(0, oldest))
fig.add_legend()

fig = sns.FacetGrid(titanic, hue='person', aspect=4)
fig.map(sns.kdeplot, 'Age', shade=True)
oldest = titanic['Age'].max()
fig.set(xlim=(0, oldest))
fig.add_legend()

fig = sns.FacetGrid(titanic, hue='Pclass', aspect=4)
fig.map(sns.kdeplot, 'Age', shade=True)
oldest = titanic['Age'].max()
fig.set(xlim=(0, oldest))
fig.add_legend()

deck = titanic['Cabin'].dropna()

levels = []
for level in deck:
    levels.append(level[0])
cabin = DataFrame(levels)
cabin.columns = ['Cabin']
sns.factorplot('Cabin', data=cabin, palette='winter_d', kind='count')