text_html_output_1.png text_plain_output_1.png
import pandas as pd

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

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

train_df.isnull().sum()

train_df['Initial'] = 0
for i in train_df:
    train_df['Initial'] = train_df.Name.str.extract('([A-Za-z]+)\\.')
pd.crosstab(train_df.Initial, train_df.Sex).T.style.background_gradient(cmap='gist_rainbow')