I have a list with points (centroids) and some of them have to be removed.
How can I do this without loops? I've tried the answer given here but this error is shown:
list indices must be integers, not list
My lists look like this:
centroids = [[320, 240], [400, 200], [450, 600]]
index = [0,2]
And I want to remove the elements in index
. The final result would be:
centroids = [[400, 200]]