# xarray.CFTimeIndex.sortlevel

#### CFTimeIndex.sortlevel(level=None, ascending=True, sort_remaining=None, na_position='first')[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L2157-L2201)

For internal compatibility with the Index API.

Sort the Index. This is for compat with MultiIndex

* **Parameters:**
  * **ascending** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *default* [`True`](https://docs.python.org/3/builtins/constants.html#True)) – False to sort in descending order
  * **na_position** (`{'first' or 'last'}`, *default* `'first'`) – Argument ‘first’ puts NaNs at the beginning, ‘last’ puts NaNs at
    the end.

    #### Versionadded
    Added in version 2.1.0.
  * **level, sort_remaining are compat parameters**
* **Returns:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index)
