Repeat data in list

Hi there, I have two lists, one has the amount of repeating and one the vales to be repeated. Say if the values to be repeated are 1, 2, 3, 4, 5 and the number of repetitions are 2, 4, 2, 3, 1 I would expect to get a list as follows: 11, 2222, 33, 444, 5 How would I do this? All my attempts so far haven’t worked, Dynamo keeps wanting to grab the whole list as a group and repeat that multiple times.

In the image above I’m looking for a nested list who’s value is 0 and count 6, value is 1 and count 4, value is 2 and count 5 etc. etc. Hope this makes sense.

Cheers,

1 Like

Hi Mathew,

It might have something to do with your lacing. If I understand your example above correctly, the following should work for you:

Hi Mathew,

here’s another aproach in case you want it as lists

1 Like

20160421-4

1 Like

Thanks for sharing! This really helped me out of a rut

Will there a solution to repeat null data?
image

Hello…could Ofreateditem work for you ?

1 Like

That’s interesting. List.Cycle and List.OfRepeatedItem have similar function.

1 Like

Yes should have, but haven’t :wink:

1 Like