numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
repeat(a, repeats, axis=None)

Parameters

a : array_like

Input array.

repeats : int or array of ints

The number of repetitions for each element. :None:None:`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 output array.

Returns

repeated_array : ndarray

Output array which has the same shape as a, except along the given axis.

Repeat elements of an array.

See Also

tile

Tile an array.

unique

Find the unique elements of an array.

Examples

>>> np.repeat(3, 4)
array([3, 3, 3, 3])
>>> x = np.array([[1,2],[3,4]])
... np.repeat(x, 2) array([1, 1, 2, 2, 3, 3, 4, 4])
>>> np.repeat(x, 3, axis=1)
array([[1, 1, 1, 2, 2, 2],
       [3, 3, 3, 4, 4, 4]])
>>> np.repeat(x, [1, 2], axis=0)
array([[1, 2],
       [3, 4],
       [3, 4]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.sparse.csgraph._flow.maximum_flow pandas.core.indexes.multi.MultiIndex.repeat pandas.core.indexes.base.Index.repeat scipy.signal._bsplines.qspline1d scipy.signal._bsplines.cspline1d_eval scipy.interpolate._polyint.KroghInterpolator pandas.core.arrays.base.ExtensionArray.repeat numpy.ma.core.repeat numpy.resize scipy.signal._bsplines.qspline1d_eval pandas.core.arrays.interval.IntervalArray.repeat dask.array.creation.repeat scipy.signal._signaltools.convolve numpy.tile scipy.signal._bsplines.cspline1d scipy.signal._signaltools.correlate pandas.core.series.Series.repeat numpy.unique dask.array.core.Array.repeat

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/core/fromnumeric.py#436
type: <class 'function'>
Commit: