# xarray.CFTimeIndex.to_series

#### CFTimeIndex.to_series(index=None, name=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L1648-L1710)

Create a Series with both index and values equal to the index keys.

Useful with map for returning an indexer based on an index.

* **Parameters:**
  * **index** ([`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index), *optional*) – Index of resulting Series. If None, defaults to original index.
  * **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), *optional*) – Name of resulting Series. If None, defaults to name of original
    index.
* **Returns:**
  [`Series`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.html#pandas.Series) – The dtype will be based on the type of the Index values.

#### SEE ALSO
`Index.to_frame`
: Convert an Index to a DataFrame.

`Series.to_frame`
: Convert Series to DataFrame.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('016dd508-d18c-4ed4-8898-d8f792450b1c','e459d292-fe7b-4c72-948d-ca5e90d47535','f9267255-4e3c-4022-b60f-acf401e20bdd','../lite/tree/../notebooks/index.html?path=2bd7931f_8ca3_47bb_a6ad_7812ea92544e.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index(["Ant", "Bear", "Cow"], name="animal")
```

By default, the original index and original name is reused.

```pycon
>>> idx.to_series()
animal
Ant      Ant
Bear    Bear
Cow      Cow
Name: animal, dtype: str
```

To enforce a new index, specify new labels to `index`:

```pycon
>>> idx.to_series(index=[0, 1, 2])
0     Ant
1    Bear
2     Cow
Name: animal, dtype: str
```

To override the name of the resulting column, specify `name`:

```pycon
>>> idx.to_series(name="zoo")
animal
Ant      Ant
Bear    Bear
Cow      Cow
Name: zoo, dtype: str
```

<div id="f9267255-4e3c-4022-b60f-acf401e20bdd" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('016dd508-d18c-4ed4-8898-d8f792450b1c','f9267255-4e3c-4022-b60f-acf401e20bdd')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('016dd508-d18c-4ed4-8898-d8f792450b1c','f9267255-4e3c-4022-b60f-acf401e20bdd')">Open In Tab</button></div><div id="e459d292-fe7b-4c72-948d-ca5e90d47535" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
