text_html_output_1.png
import pandas as pd

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

categorical = train.dtypes[train.dtypes == 'object'].index

train.isnull().sum()

train['Initial'] = 0
for i in train:
    train['Initial'] = train.Name.str.extract('([A-Za-z]+)\\.')
test['Initial'] = 0
for i in test:
    test['Initial'] = train.Name.str.extract('([A-Za-z]+)\\.')