application_vnd.jupyter.stderr_output_1.png
import pandas as pd

train_set = pd.read_csv('train.csv')
test_set = pd.read_csv('test.csv')

def extract_title(name):
    return name.split(',')[1].split()[0].strip()

train_set['Title'] = train_set['Name'].apply(extract_title)