Replace index value with another index value from the previous list

Hello everyone!!

I am trying to replace the 0 value at index 0 with the value from index 2 from the previous list. I am unsure on how to go about doing this. Please give me your feedback.

Thank you!


Hello @C3312854 ,

Something like this…

KR

Andreas

1 Like

Hello Andreas!

thank you for your feedback, but the lists in question is actually a sublist, so i am intending to replace the values within the sublists itself without splitting the list.

1 Like


@C3312854

1 Like

Hi Andreas, is there an way that I can retain the list output, meaning also show list 1 and 2 in the output. Your method shows the output of the final list, but I am intending show both the list in a single output similar to the image I sent above. Please do let me know your feedback.

Thanks!

kathir

1 Like

The reason i am asking this is because i have a lot of sub lists and splitting the list output is not really feasible for what i am trying to work towards.

Hey Andreas, is there a possibility to use a python script instead to make this process more streamlined? I have 0 knowledge on python script as i am a civil engineering student.

thanks!

kathir

2022-05-06_11h00_38
thats still design script :wink:

1 Like

Hey Andreas, Thank you for this!

I will try to implement this and let you know.

Thank you!

Kathir

I would like spent more time in pyhton

officily i am not in this forum. I follow a regually job.

1 Like

oh thank you!

Thanks to Andreas’s help, I was able to come up with the following list. The output of the code only shows the first 2 list, I want to continue this is a loop manner as I have many other sub list. Basically, I want to change the value of list 1 index 0 with the value from list 0 index 2, value of list 2 index 0 from with the value from list 1 index 2 so on an so forth in a looped manner if possible such that it outputs all the lists with the replaced values. Any help will be appreciated.

Thanks!!

Kathir

1 Like

Hello! I managed to solve the issue by using the OOTB nodes in Dynamo Itself. Thank you Andreas for helping me!

Kathir

1 Like