[Python] How can I transform a nested list to tree with branches?


L = [[a1,b1],[a1,b1],...,[an,bn]]


to this:

with Python?

Never mind, I got it

from ghpythonlib import treehelpers as th

L = [[a1,b1],[a1,b1],...,[an,bn]]
a = th.list_to_tree(L)


I respect you trying to help and answer my question, but being a Moderator or not, leave the original poster to decide what is a solution and what is not.


No problem. Thanks for sharing your solution