我想以这种方式从数组列表中删除数组
我想要移除一个元素。
i = np.array([1,2])
facets = [np.array([1,2]),np.array([3,4])]
我想要移除一个元素。
facets.remove(np.array(i[0],i[1]))
但是出现了错误:
ValueError Traceback (most recent call last)
<ipython-input-131-c0d040653e23> in <module>()
----> 1 facets.remove([i[0],i[2]])
ValueError: The truth value of an array with more than one element is ambiguous.
Use a.any() or a.all()
有没有解决这个问题的方法?
facets
的声明引发了一个错误。 - undefinedfacets.remove(np.array([i[0],i[1]]))
。 - undefined