# xarray.CFTimeIndex.repeat

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

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('9e13f79c-477c-43a1-9efa-8f5f98f6f206','7c8d8356-f818-4f5a-a516-11621a096c70','ac36e1b6-cf8e-493f-9922-91faf8d4faea','../lite/tree/../notebooks/index.html?path=8804d309_f302_4892_8b9b_c4077019eb10.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="ac36e1b6-cf8e-493f-9922-91faf8d4faea" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('9e13f79c-477c-43a1-9efa-8f5f98f6f206','ac36e1b6-cf8e-493f-9922-91faf8d4faea')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('9e13f79c-477c-43a1-9efa-8f5f98f6f206','ac36e1b6-cf8e-493f-9922-91faf8d4faea')">Open In Tab</button></div><div id="7c8d8356-f818-4f5a-a516-11621a096c70" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
