# 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('a9ce12b7-ca0b-46f5-8e56-907a2baa1eee','c57eca4f-972b-4f8b-8068-4d33771131e7','94e24f2b-79cb-498c-9695-88e9287a4162','../lite/tree/../notebooks/index.html?path=2b858abf_8357_4d4e_8851_4e5c30653949.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="94e24f2b-79cb-498c-9695-88e9287a4162" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('a9ce12b7-ca0b-46f5-8e56-907a2baa1eee','94e24f2b-79cb-498c-9695-88e9287a4162')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('a9ce12b7-ca0b-46f5-8e56-907a2baa1eee','94e24f2b-79cb-498c-9695-88e9287a4162')">Open In Tab</button></div><div id="c57eca4f-972b-4f8b-8068-4d33771131e7" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
