def clean_data(df, primary_key=None):
    """ Drops null & duplicate rows """
    if primary_key:
        df = df.dropna(subset=[primary_key])
        df = df.drop_duplicates(subset=[primary_key], keep='first')

    df = df.dropna(how='all')
    return df