I have a list of 20 doors and a second list of 2 doors that are also in the list of the 20 doors.
I want to create a list with true values for the 2 doors and keep the original list structure.
For some reason it works on 1 door but not on both… I’m 10000% sure that both doors should give a true value!
Are your lists nested in a bigger list? Maybe you need to select the @@ setting in the == command. Also have you tried setting the == node to cross-lacing?
@Vikram_Subbaiah Seems almost the same, but my main list doesn’t have a @4 level, it has the same levels as the list with the items to check… And i need these same levels later on in the graph with a true/false value
It seems like you have an extra level sublists for your sublists, I don’t have that…
@Daan I’ve tried every combination with the list levels. Cross lacing is not the solution, it will give too much true values since the doors are in multiple sublists. The combination == should only be within the same sublist…
Not everything can be accomplished with list levels alone (depending on the list structure). Python is usually your best bet in these situations.
listA = IN[0]
listB = IN[1]
result = []
for subA,subB in zip(listA,listB):
out = []
for A in subA:
out.append(A in subB)
result.append(out)
OUT = result