Return the indices that would sort this array.
Whether the indices should result in an ascending or descending sort.
Sorting algorithm.
If 'first', put NaN values at the beginning. If 'last', put NaN values at the end.
Passed through to numpy.argsort().
Array of indices that sort self. If NaN values are contained, NaN values are placed at the end.
See also
numpy.argsortSorting implementation used internally.
Examples
>>> arr = pd.array([3, 1, 2, 5, 4])
>>> arr.argsort()
array([1, 2, 0, 4, 3])
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.api.extensions.ExtensionArray.argsort.html