Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

List challenge

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images