sort#

IndexSetND.sort(*, key=None, reverse=False)[source]#

Sort the IndexSet in ascending order, in-place.

Parameters:
keyfunction, optional

Function to be applied to each element to get comparison keys for sorting order, by default None.

reversebool, default False

Whether to sort in descending order.

Raises:
TypeError

When the IndexSet has non-comparable elements i.e., heterogeneous data types like int and str within the same IndexSet.