# xarray.CFTimeIndex.repeat

#### CFTimeIndex.repeat(repeats, axis=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.15/site-packages/pandas/core/indexes/base.py#L1330-L1372)

Repeat elements of an Index.

Returns a new Index where each element of the current Index
is repeated consecutively a given number of times.

* **Parameters:**
  * **repeats** ([`int`](https://docs.python.org/3/builtins/functions.html#int) or [array](https://numpy.org/doc/stable/glossary.html#term-array) of `ints`) – The number of repetitions for each element. This should be a
    non-negative integer. Repeating 0 times will return an empty
    Index.
  * **axis** ([`None`](https://docs.python.org/3/builtins/constants.html#None)) – Must be `None`. Has no effect but is accepted for compatibility
    with numpy.
* **Returns:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index) – Newly created Index with repeated elements.

#### SEE ALSO
`Series.repeat`
: Equivalent function for Series.

[`numpy.repeat`](https://numpy.org/doc/stable/reference/generated/numpy.repeat.html#numpy.repeat)
: Similar method for [`numpy.ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray).

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('ef35011c-f30a-4174-b819-ccdfcb9a4f13','5cffe3a2-ee45-4b13-b47b-a9757e638e50','03c9feca-4d07-4ead-8ab3-976307eebb40','../lite/tree/../notebooks/index.html?path=af14247d_b7e4_45e9_bb94_8be134890e90.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index(["a", "b", "c"])
>>> idx
Index(['a', 'b', 'c'], dtype='str')
>>> idx.repeat(2)
Index(['a', 'a', 'b', 'b', 'c', 'c'], dtype='str')
>>> idx.repeat([1, 2, 3])
Index(['a', 'b', 'b', 'c', 'c', 'c'], dtype='str')
```

<div id="03c9feca-4d07-4ead-8ab3-976307eebb40" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('ef35011c-f30a-4174-b819-ccdfcb9a4f13','03c9feca-4d07-4ead-8ab3-976307eebb40')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('ef35011c-f30a-4174-b819-ccdfcb9a4f13','03c9feca-4d07-4ead-8ab3-976307eebb40')">Open In Tab</button></div><div id="5cffe3a2-ee45-4b13-b47b-a9757e638e50" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
