def METHOD_NAME(segments):
    """Map chromosome names to integers in the order encountered."""
    mapping = collections.OrderedDict(
        (chrom, i + 1)
        for i, chrom in enumerate(segments.chromosome.drop_duplicates())
        if str(i + 1) != chrom
    )
    return mapping