First page Back Continue Last page Overview Graphics

tile Method

tile(A, reps)

Construct an array by repeating A the number of times given by reps.

If „reps“ has length „d“, the result will have dimension of max(d, A.ndim).

>>> np.tile(42,3)

array([42, 42, 42])

>>> np.tile([2,4],2)

array([2, 4, 2, 4])

>>> np.tile([2,4],3)

array([2, 4, 2, 4, 2, 4])

>>> np.tile([[1,3],[2,4]],2)

array([[1, 3, 1, 3],

[2, 4, 2, 4]])

>>> np.tile([[1,3],[2,4]],(2,2))

array([[1, 3, 1, 3],

[2, 4, 2, 4],

[1, 3, 1, 3],

[2, 4, 2, 4]])