I want replicate a small array to specific length array
Example:
var = [22,33,44,55] # ==> len(var) = 4
n = 13
The new array tha
There are better ways to replicate the array, for example you could simply use np.resize:
Return a new array with the specified shape.
If the new array is larger than the original array, then the new array is filled with repeated copies of
a
. [...]
>>> import numpy as np
>>> var = [22,33,44,55]
>>> n = 13
>>> np.resize(var, n)
array([22, 33, 44, 55, 22, 33, 44, 55, 22, 33, 44, 55, 22])