# xarray.CFTimeIndex.argsort

#### CFTimeIndex.argsort(\*args, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L6051-L6088)

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.

#### SEE ALSO
[`numpy.argsort`](https://numpy.org/doc/stable/reference/generated/numpy.argsort.html#numpy.argsort)
: Similar method for NumPy arrays.

`Index.sort_values`
: Return sorted copy of Index.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('00db85e7-7b01-46e7-a0cd-c71c33109ca9','cab9101a-8f53-47fd-b965-6b52b898c184','da573a5f-7f53-4e89-b9d9-9e57a263d626','../lite/tree/../notebooks/index.html?path=1d38198e_d1d2_423a_81cc_8be4db334d83.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index(["b", "a", "d", "c"])
>>> idx
Index(['b', 'a', 'd', 'c'], dtype='str')
```

```pycon
>>> order = idx.argsort()
>>> order
array([1, 0, 3, 2])
```

```pycon
>>> idx[order]
Index(['a', 'b', 'c', 'd'], dtype='str')
```

<div id="da573a5f-7f53-4e89-b9d9-9e57a263d626" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('00db85e7-7b01-46e7-a0cd-c71c33109ca9','da573a5f-7f53-4e89-b9d9-9e57a263d626')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('00db85e7-7b01-46e7-a0cd-c71c33109ca9','da573a5f-7f53-4e89-b9d9-9e57a263d626')">Open In Tab</button></div><div id="cab9101a-8f53-47fd-b965-6b52b898c184" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
