def get_type_ticket(df):
    """Indicate if a person has a 'Ticket'

    Parameters
    ----------
    df : panda dataframe
    
    Returns
    -------
    Categorical unique code
    """
    # Feature that tells whether a passenger had a cabin on the Titanic
    df['Type_Ticket'] = df['Ticket'].apply(lambda x: x[0:3])
    df['Type_Ticket'] = df['Type_Ticket'].astype('category').cat.codes # ordinal encoding
    df['Type_Ticket'] = df['Type_Ticket'].astype(int)
    
    return df