I have a list: my_list=collect(1:n)', and a repeatability vector:
repeat_list = [n1, n1, n2, n1, n2, n2]. I would like to create a new list with
repeated n1
times, 2 repeated n1
times, 3 repeated n2
times, etc. The length of the list could be a few hundred thousand. Is there a known “best” way to accomplish this? In the meantime, I keep searching. Thanks.
5 posts - 4 participants