pandas.Index.repeat#

Index.repeat(repeats, axis=None)[source]#

Repeat elements of a Index.

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

Parameters:
repeatsint or 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.

axisNone

Must be None. Has no effect but is accepted for compatibility with numpy.

Returns:
Index

Newly created Index with repeated elements.

See also

Series.repeat

Equivalent function for Series.

numpy.ndarray.