# xarray.CFTimeIndex.item

#### CFTimeIndex.item()[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.15/site-packages/pandas/core/base.py#L417-L455)

Return the first element of the underlying data as a Python scalar.

This method extracts the single element from a length-1 Series or
Index and returns it as a native Python scalar type (e.g., `int`,
`float`, `str`).

* **Returns:**
  [scalar](../user-guide/terminology.html.md#term-scalar) – The first element of Series or Index.
* **Raises:**
  [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – If the data is not length = 1.

#### SEE ALSO
`Index.values`
: Returns an array representing the data in the Index.

`Series.head`
: Returns the first n rows.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('7148fc3c-4deb-4e39-86cc-86ca261669ff','0fc3e588-fa2d-412e-9d46-199fd9a0c6f3','681322e0-3322-4887-be61-f7a117dc8d9b','../lite/tree/../notebooks/index.html?path=9e6e0e5c_e28a_45e2_8393_ec05978bd5f1.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> s = pd.Series([1])
>>> s.item()
1
```

For an index:

```pycon
>>> s = pd.Series([1], index=["a"])
>>> s.index.item()
'a'
```

<div id="681322e0-3322-4887-be61-f7a117dc8d9b" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('7148fc3c-4deb-4e39-86cc-86ca261669ff','681322e0-3322-4887-be61-f7a117dc8d9b')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('7148fc3c-4deb-4e39-86cc-86ca261669ff','681322e0-3322-4887-be61-f7a117dc8d9b')">Open In Tab</button></div><div id="0fc3e588-fa2d-412e-9d46-199fd9a0c6f3" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
