find in which sublist of a list are any value of a list in python
I'm assuming Elements is always a list of continuous indices from zero to the length of Nodes minus one and thus strictly not needed.
As a general guideline, explicit loops tend to be slow and also hard to read (and non-Pythonic).
To solve your problem efficiently, use data structures (namely sets):
import numpy as np

# Suppose you start with these lists
u = [1,2,10,40,400,1000]
n = [[1,20,25],[30,400,35],[500,501,502]]

# Convert them into sets
u = set(u)
n = [set(x) for x in n]

#  An individual bit is true if the corresponding list is &quot;interesting&quot;
idx = [bool(a.intersection(u)) for a in n]

# Perhaps convert to integer indices if you wish
np.where(idx)