I have array with values sourceArray and I have array with values to replace toReplace. I want to replace all values that are in sourceArray that are equal to values in toReplace array.
Is there some smart way to do it in Python ?
E.g.
sourceArray = [0,1,2,3,4,5,5,6,7]
toReplace = [5,6]
After replace I want to have
sourceArray = [0,1,2,3,4,0,0,0,7]