# 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('e76c311a-ea35-4a87-bfab-1a92ccb4f6b1','4fe3fef2-7bff-4e0d-a7d7-577d8a3ad92e','cb39bc28-5c8e-4f4a-a0bb-c19ef5c810f6','../lite/tree/../notebooks/index.html?path=d387355e_7e43_4be8_8317_88725ce5732a.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="cb39bc28-5c8e-4f4a-a0bb-c19ef5c810f6" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('e76c311a-ea35-4a87-bfab-1a92ccb4f6b1','cb39bc28-5c8e-4f4a-a0bb-c19ef5c810f6')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('e76c311a-ea35-4a87-bfab-1a92ccb4f6b1','cb39bc28-5c8e-4f4a-a0bb-c19ef5c810f6')">Open In Tab</button></div><div id="4fe3fef2-7bff-4e0d-a7d7-577d8a3ad92e" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
