A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/../api/pandas.Index.argsort.html below:

pandas.Index.argsort — pandas 2.3.1 documentation

pandas.Index.argsort#
Index.argsort(*args, **kwargs)[source]#

Return the integer indices that would sort the index.

Parameters:
*args

Passed to numpy.ndarray.argsort.

**kwargs

Passed to numpy.ndarray.argsort.

Returns:
np.ndarray[np.intp]

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

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4