def exclude_bad(data, columns, values):
    """Exclude rows of data with poor quality control flags.
    eg. data_new = exlcude_bad(data,
                               ['Practical Salinity Corrected QC Flag '],
                               [0,4,9])
    :arg data: the data set
    :type data: pandas DataFrame

    :arg columns: Column names with quality control information
    :type columns: list of strings

    :arg values: the quaility control values to be exlcuded
    :type values: lis tof integers

    :returns: data_return - new data frame with bad data excluded.
    """

    data_return = data
    for col in columns:
        for val in values:
            data_return = data_return[data_return[col] != val]
    return data_return