numpy.repeat()

numpy.repeat

numpy.repeat(a, repeats, axis=None) [source]

Repeat elements of an array.

Parameters:

a : array_like

Input array.

repeats : int or array of ints

The number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis.

axis : int, optional

The axis along which to repeat values. By default, use the flattened input array, and return a flat outp