text_plain_output_1.png
import matplotlib.pyplot as plt # plotting

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns # combined plotting

df = pd.read_csv('../input/train.csv', index_col=0)
df_test = pd.read_csv('../input/test.csv', index_col=0)

df.dtypes

def cond_hists(df, plot_cols, grid_col):
    for col in plot_cols:
        grid1 = sns.FacetGrid(df, col=grid_col)
        grid1.map(plt.hist, col, alpha=0.7)
    return grid_col
df.Sex = df.Sex.map({'male': 0, 'female': 1})
df_test.Sex = df_test.Sex.map({'male': 0, 'female': 1})
plot_cols = ['Pclass', 'Age', 'Sex', 'Parch', 'SibSp']
cond_hists(df, plot_cols, 'Survived')