This question already has an answer here:
这个问题已经有了答案:
- How to remove specific elements in a numpy array 5 answers
- 如何删除numpy数组5中的特定元素
If you have array = np.array([1,2,3,4])
and you have index = np.array([0,1,2])
and you want to remove the index elements in array, what's the best way to do this without looping?
如果数组= np.array([1,2,3,4])和index = np.array([0,1,2])要删除数组中的索引元素,最好的方法是什么?