Python has an ordered dictionary. What about an ordered set?
In case you're already using pandas in your code, its Index
object behaves pretty like an ordered set, as shown in this article.
Examples from the article:
indA = pd.Index([1, 3, 5, 7, 9])
indB = pd.Index([2, 3, 5, 7, 11])
indA & indB # intersection
indA | indB # union
indA - indB # difference
indA ^ indB # symmetric difference