Trying to index or remove a numpy array item from a python list, does not fail as expected on first item.
import numpy as np
# works:
lst = [np.array([1,2]), np.array([3,4])]
lst.index(lst[0])
# fails with: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
lst = [np.array([1,2]), np.array([3,4])]
lst.index(lst[1])
I understand why the second fails, I would like to understand why the first one works.