# welcome to softhunt.net
# Python Program illustrating
# numpy.tile()
import numpy as np
arr = np.arange(3)
print("arr :
", arr)
a = 2
b = 2
repetitions = (a, b)
print("
Repeating arr :
", np.tile(arr, repetitions))
print("arr Shape :
", np.tile(arr, repetitions).shape)
a = 3
b = 2
repetitions = (a, b)
print("
Repeating arr :
", np.tile(arr, repetitions))
print("arr Shape :
", np.tile(arr, repetitions).shape)
a = 2
b = 3
repetitions = (a, b)
print("
Repeating arr :
", np.tile(arr, repetitions))
print("arr Shape :
", np.tile(arr, repetitions).shape)
# welcome to softhunt.net
# Python Program illustrating
# numpy.tile()
import numpy as np
#Working on 1D
arr = np.arange(5)
print("arr :
", arr)
repetitions = 2
print("Repeating arr 2 times :
", np.tile(arr, repetitions))
repetitions = 3
print("
Repeating arr 3 times :
", np.tile(arr, repetitions))
# [0 1 2 ..., 2 3 4] means [0 1 2 3 4 0 1 2 3 4 0 1 2 3 4]
# since it was long output, so it uses [ ... ]
numpy.tile(arr, repetitions)