# 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('c432f9a3-08d2-48a7-80ec-e3e1a6ad3e91','42812961-6275-456f-b5e6-06612d615313','bc5f8856-0271-4dcb-a476-34313cf13709','../lite/tree/../notebooks/index.html?path=c6259285_72e5_4030_a0ea_d3db901866b5.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="bc5f8856-0271-4dcb-a476-34313cf13709" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('c432f9a3-08d2-48a7-80ec-e3e1a6ad3e91','bc5f8856-0271-4dcb-a476-34313cf13709')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('c432f9a3-08d2-48a7-80ec-e3e1a6ad3e91','bc5f8856-0271-4dcb-a476-34313cf13709')">Open In Tab</button></div><div id="42812961-6275-456f-b5e6-06612d615313" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
