Replace items at index in lists

Hi,

I have a first list of 5 lists, each list contains 6 null items.
I have a second list of 5 lists, each list contains the index value where I want to insert my x value in the first list.

I tried “replaceItemAtIndex” but it is not working for a list of Index.
I tried python but I couldn’t write the code properly.

Could someone help me?


replace list items at index.dyn (18.9 KB)

Hi @clementcazi,

Welcome to the Dynamo community.
Try this:
replace list items at index.dyn (11.6 KB)

OUT = [[IN[2] if i in y else x[i] for i,j in enumerate(x)] for x,y in zip(IN[0],IN[1])]
1 Like

Hi @AmolShah,

Thank you, it is working.

1 Like