# 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('36820cf8-3850-4d23-9e3d-4e41f95cc57e','be31fb79-1387-4a65-9bc5-d73455903cbd','e1d6173a-6558-4b6c-acf1-adf45c75d6ff','../lite/tree/../notebooks/index.html?path=845bd909_d32d_4f9a_910c_d560edf53ed3.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="e1d6173a-6558-4b6c-acf1-adf45c75d6ff" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('36820cf8-3850-4d23-9e3d-4e41f95cc57e','e1d6173a-6558-4b6c-acf1-adf45c75d6ff')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('36820cf8-3850-4d23-9e3d-4e41f95cc57e','e1d6173a-6558-4b6c-acf1-adf45c75d6ff')">Open In Tab</button></div><div id="be31fb79-1387-4a65-9bc5-d73455903cbd" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
