Filter by layers

Hello everyone,

how to filter sublist that contains another sublist in a proper order? Elements can only be before and after.

Thanks in advance.


@Marci ,

try using boolean operators is list in list…

grafik

KR

Andreas

Hello, there is definitely a better way, here is one


python script

Rank=IN[1]
Lists=IN[0]
container=[]
for i,j in zip(Rank,Lists):
    if i==1:
        container.append(j)
    else:
        for k in range(0,len(j)):
            container.append(j[k])
OUT = container

cordially
christian.stan

Hello @christian.stan,

thanks for the help, this would be the expected result, maybe now it’s more understandable.

1 Like

Hello, I thought the order mattered in your first post.

Cordially
christian.stan

1 Like