xorbits.pandas.Index.argsort#

Index.argsort(*args, **kwargs) npt.NDArray[np.intp][source]#

Return the integer indices that would sort the index.

Parameters
  • *args – Passed to numpy.ndarray.argsort.

  • **kwargs – Passed to numpy.ndarray.argsort.

Returns

Integer indices that would sort the index if used as an indexer.

Return type

np.ndarray[np.intp]

See also

numpy.argsort

Similar method for NumPy arrays.

Index.sort_values

Return sorted copy of Index.

Examples

>>> idx = pd.Index(['b', 'a', 'd', 'c'])  
>>> idx  
Index(['b', 'a', 'd', 'c'], dtype='object')
>>> order = idx.argsort()  
>>> order  
array([1, 0, 3, 2])
>>> idx[order]  
Index(['a', 'b', 'c', 'd'], dtype='object')

Warning

This method has not been implemented yet. Xorbits will try to execute it with pandas.

This docstring was copied from pandas.core.indexes.base.Index.