I have a python function with the following signature:
def merge(segments, indexes):
where segments is a n-d numpy array and indexes is a one dimensional numpy array. Now, I want to call the following function:
np.where((segments == indexes[0]) | (segments == indexes[1]) |
... segments == indexes[n])
However, I am not sure how I can generate this condition dynamically within the where() function call in python.
nthe length of indexes list?