I want to do something similar to what was asked here NumPy array, change the values that are NOT in a list of indices, but not quite the same.
Consider a numpy
array:
> a = np.array([0.2, 5.6, 88, 12, 1.3, 6, 8.9])
I know I can access its elements via a list of indexes, like:
> indxs = [1, 2, 5]
> a[indxs]
array([ 5.6, 88. , 6. ])
But I also need to access those elements which are not in the indxs
list. Naively, this is:
> a[not in indxs]
> array([0.2, 12, 1.3, 8.9])
What is the proper way to do this?