I have a NumPy array like:
a = np.arange(30)
I know that I can replace the values located at positions indices=[2,3,4]
using for instance fancy indexing:
a[indices] = 999
But how to replace the values at the positions that are not in indices
? Would be something like below?
a[ not in indices ] = 888
np.ones_like
– Gabriel