Repeat each element or tile the whole array several times.
Numeric.shape.repeat(input, repeats, times, level)Repeats entries or tiles the whole array.
- Parameters:
input: Array whose entries are repeatedrepeats: Number of repetitions appliedtimes: When true tiles the whole array insteadlevel: Optional axis when repeating a matrix or tile flag
- Returns: Array holding the repeated values
- NumPy: Covers
np.repeat,np.tile,ndarray.repeatthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const values = Numeric.shape.repeat([1, 2], 2)
console.log(values)
// [1,1,2,2]import Numeric from '@neabyte/numerix'
const values = Numeric.shape.repeat([1, 2], 2, true)
console.log(values)
// [1,2,1,2]import Numeric from '@neabyte/numerix'
const values = Numeric.shape.repeat([1, 2], 3)
console.log(values)
// [1,1,1,2,2,2]import Numeric from '@neabyte/numerix'
const matrix = Numeric.shape.repeat([[1, 2]], 2, true)
console.log(matrix)
// [[1,2,1,2]]