Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c08f81c

Browse files
authored
DOC: Add element-wise repeat example to numpy.repeat (#31552)
1 parent 48c5a5e commit c08f81c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

numpy/_core/fromnumeric.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ def repeat(a, repeats, axis=None):
466466
>>> import numpy as np
467467
>>> np.repeat(3, 4)
468468
array([3, 3, 3, 3])
469+
>>> np.repeat([4, 5, 6], [1, 2, 3])
470+
array([4, 5, 5, 6, 6, 6])
469471
>>> x = np.array([[1,2],[3,4]])
470472
>>> np.repeat(x, 2)
471473
array([1, 1, 2, 2, 3, 3, 4, 4])

0 commit comments

Comments
 (0)