def _highest_error_only(errors):
    """Removes any duplicate concentrations that have lower errors.

    This script take a list of errors and concentrations and returns
    only the highest error for each concentration.

    Parameters
    ----------
    errors : list of lists of floats
        A list containing [errors,[concentrations]] in each list entry.

    Returns
    -------
    sorted_errors : list of list of floats
        The reduced list of errors.
    """

    sorted_errors = []
    concs = []
    for er in errors:
        c = er[0]

        if c not in concs:
            concs.append(c)
            sorted_errors.append([c,er[1]])
        else:
            loc = concs.index(c)
            # print("loc",loc)
            if sorted_errors[loc][1] < er[1]:
                sorted_errors[loc][1] = er[1]
                # print(er[1])

    return sorted_errors