Hi,
Can you help me? what is wrong?
Change line 5:
list1 = [0]
into
list1 = IN[0]
(oh btw: you can use list.join to do the same.)
The most efficient way I’ve found is to use:
from itertools import chain
lst1 = IN[0]
newlist = list(chain.from_iterable(lst1))
OUT = newlist
EDIT: I’ve verified that this works with Ironpython.
The question was why his script wasn’t working (he just missed the “IN”-part) … but I must say: good suggestion (saves some loops ) @Jonathan.Olesen.
The most efficient way was to just use list.join??
True @3Pinter
Depending on the use and intention of the final graph/script and if the import needs to go into python for processing before being flattened I agree that List.Join is the most elegant solution avoiding the need for Python all together.