def convert_value_to_level_sequence(value_sequence, bins):
    levels = []
    for value in value_sequence:
        level = 0
        for (bin_no, bin_upper_limit) in enumerate(bins):
            if (value > bin_upper_limit):
                level += 1
            else:
                break
        levels.append(level)
    return levels
def convert_value_to_level_sequence(value_sequence, bins):
    levels = []
    for value in value_sequence:
        level = 0
        for (bin_no, bin_upper_limit) in enumerate(bins):
            if (value > bin_upper_limit):
                level += 1
            else:
                break
        levels.append(level)
    return levels