# xarray.CFTimeIndex.get_level_values

#### CFTimeIndex.get_level_values(level)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L2203-L2240)

Return an Index of values for requested level.

This is primarily useful to get an individual level of values from a
MultiIndex, but is provided on Index as well for compatibility.

* **Parameters:**
  **level** ([`int`](https://docs.python.org/3/builtins/functions.html#int) or [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – It is either the integer position or the name of the level.
* **Returns:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index) – Calling object, as there is only one level in the Index.

#### SEE ALSO
`MultiIndex.get_level_values`
: Get values for a level of a MultiIndex.

### Notes

For Index, level should be 0, since there are no multiple levels.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('2e53b0d3-2c05-4fee-8465-d26d9bdcd024','e449b55d-6092-419c-8b84-ab4ecc8c3a5b','acf92ffe-b227-42d8-b95f-d842d7199624','../lite/tree/../notebooks/index.html?path=b61d8b96_415a_41ca_ba79_4570372af9dd.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index(list("abc"))
>>> idx
Index(['a', 'b', 'c'], dtype='str')
```

Get level values by supplying level as integer:

```pycon
>>> idx.get_level_values(0)
Index(['a', 'b', 'c'], dtype='str')
```

<div id="acf92ffe-b227-42d8-b95f-d842d7199624" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('2e53b0d3-2c05-4fee-8465-d26d9bdcd024','acf92ffe-b227-42d8-b95f-d842d7199624')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('2e53b0d3-2c05-4fee-8465-d26d9bdcd024','acf92ffe-b227-42d8-b95f-d842d7199624')">Open In Tab</button></div><div id="e449b55d-6092-419c-8b84-ab4ecc8c3a5b" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
