def fromtargetlist(samples, targets, targetlist):
    """
    Return a samples and targets data frame filtered by target values
    (needs at least 2 targets in the list).
    """
    if len(targetlist)<2:
        raise ValueError("Targetlist argument must be a list with size >1.")

    mask = targets.label == targetlist.pop()
    for target in targetlist:
        mask = (mask) | (targets.label == target)
    return samples[mask], targets[mask]