Merging sub-sublists based on the sublist they belong to

Good day all!

Thank you for clicking into this thread.

I have been struggling to deal with list and I wonder what combination of nodes achieve the operation shown inside the image. It would be great if there is no python node involve in the operation.

I tried different combinations using AddItem, Insert, Flatten, Transpose, Create, Join and Combine, but failed to reach the desired result. Please kindly advise the solution, many thanks in advance.

Hello @kelvin_law and welcome
a solution with Python

import sys

OUT = [i + j for i, j in zip(IN[0], IN[1])]
# OR #
OUT = [sum(i, []) for i in zip(*IN)]
1 Like

@kelvin_law try this:

1 Like

Two approaches …

List.Flatten(List.AddItemToEnd(a<1>,b<1>)<1><2>,1);

or

List.Flatten(List.Transpose([a,b])<1>,1);

merge.dyn (24.6 KB)

3 Likes