I know how to replace all the elements of a NumPy array that are greater than some of the values, like array[array > 0] = 0, but I don't know how to replace all the elements that are equal to some values without using the for loop, like below can I achieve what I want but is there any way not to use the for loop?
Sorry for being unclear, some_values here is a list, like [7, 8, 9]
for v in some_values:
array[array == v] = 0