def get_titles(df):
    """Return a column containing passenger titles.

    All titles found in data:

    {'Ms', 'Dona', 'Don', 'Col', 'Lady', 'Jonkheer', 'Miss', 'the', 'Master',
    'Capt', 'Sir', 'Dr', 'Rev', 'Major', 'Mlle', 'Mme', 'Mr', 'Mrs'}

    """

    mapping = {'Mlle': 'Miss', 'Major': 'Mr', 'Col': 'Mr', 'Sir': 'Mr', 'Don': 'Mr',
               'Mme': 'Miss', 'Jonkheer': 'Mr', 'Lady': 'Mrs', 'Capt': 'Mr',
               'the': 'Mrs', 'Ms': 'Miss', 'Dona': 'Mrs', 'Dr': 'Mr'}

    names = df['Name']

    def title_func(name):
        title = name.split(',')[1].strip().split(' ')[0].strip('.')
        title = mapping.get(title, title)
        return title

    return names.apply(title_func)