'Whether the array has duplicates.  Takes NaNs into account.'

def has_duplicates(self, arr):

    if (np.count_nonzero(np.isnan(arr)) > 1):
        return True
    if (np.unique(arr).size < arr.size):
        return True
    return False
