# xarray.CFTimeIndex.get_level_values

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

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('29888023-b926-4ceb-bef8-eeae2acc2ecc','c240f0a1-747d-4980-84b7-4067bf398381','c07c6134-513f-4eec-b4d5-6d8824abe051','../lite/tree/../notebooks/index.html?path=2d0e00d2_156b_4dc5_8f94_4f4d2ca73cda.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="c07c6134-513f-4eec-b4d5-6d8824abe051" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('29888023-b926-4ceb-bef8-eeae2acc2ecc','c07c6134-513f-4eec-b4d5-6d8824abe051')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('29888023-b926-4ceb-bef8-eeae2acc2ecc','c07c6134-513f-4eec-b4d5-6d8824abe051')">Open In Tab</button></div><div id="c240f0a1-747d-4980-84b7-4067bf398381" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
