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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…