Use numpy
arrays and the numpy.repeat
function.
import numpy as np x = np.array(["A", "B"]) print np.repeat(x, [2, 3], axis=0)
['A' 'A' 'B' 'B' 'B']
Use numpy
arrays and the numpy.repeat
function.
import numpy as np x = np.array(["A", "B"]) print np.repeat(x, [2, 3], axis=0)
['A' 'A' 'B' 'B' 'B']