Index.argsort(*args, **kwargs) [source]
Return the integer indicies that would sort the index.
| Parameters: |
*args Passed to **kwargs Passed to |
|---|---|
| Returns: |
numpy.ndarray Integer indicies that would sort the index if used as an indexer. |
See also
numpy.argsort
Index.sort_values
>>> 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')
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.Index.argsort.html