ENH: Add sort parameter to set operations for some Indexes and adjust… by reidy-p · Pull Request #24521 · pandas-dev/pandas (original) (raw)

… tests

This PR makes some progress towards adding a sort parameter with a default of True to the set operations (union, intersection, difference and symmetric_difference) on Index classes. Adding this parameter into every type of Index would result in a very big PR so I have decided to break it up and try to add it in stages. I have tried to focus on Index, MultiIndex, PeriodIndex and Intervalndex in this PR but have made some very small changes to set operations on other indices where necessary.

Some issues to consider: