什么是从numpy数组中删除元素并检索它们的初始位置的最快方法?下面的代码没有返回应该返回的所有元素:
list = []
for pos,i in enumerate(ARRAY):
if i < some_condition:
list.append(pos) #This is where the loop fails
for _ in list:
ARRAY = np.delete(ARRAY, _)