xorbits.pandas.Index.argsort#

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

Return the integer indices that would sort the index.

参数
  • *args – Passed to numpy.ndarray.argsort.

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

返回

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

返回类型

np.ndarray[np.intp]

参见

numpy.argsort

Similar method for NumPy arrays.

Index.sort_values

Return sorted copy of Index.

实际案例

>>> 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')

警告

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.