-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
Enhancementsetopsunion, intersection, difference, symmetric_differenceunion, intersection, difference, symmetric_difference
Description
I often want to remove certain elements from an index while retaining the original ordering of the index. For this reason a sort keyword in the index.difference method would be required:
In: index = pd.Index([0, 1, 2, 4, 3]) In: index.difference({1, 2}) Out: Int64Index([0, 3, 4], dtype='int64') # It would be cool to have instead In: index.difference({1, 2}, sort=False) Out: Int64Index([0, 4, 3], dtype='int64') I think that this usecase appears frequently and setting the default to sort=True doesn't affect existing code.
Metadata
Metadata
Assignees
Labels
Enhancementsetopsunion, intersection, difference, symmetric_differenceunion, intersection, difference, symmetric_difference