import re


def clean_data(df):
    """
    Clean dataframe

    Drop duplicates, remove non-characters ad lower text in message column

    Parameters:
    df (pandas dataframe): dataframe containing data 

    Returns:
    df (pandas dataframe): processed dataframe

    """
    df = df.drop_duplicates()
    df['message'] = df.message.apply(lambda x: re.sub(r"[^a-zA-Z0-9]", " ", x))
    df['message'] = df['message'].apply(lambda x: x.lower())
    return df