I\'ve got a list (used as a stack) of numpy arrays. Now I want to check if an array is already in the list. Had it been tuples for instance, I would simply have written some
You can convert the array into a list by using tolist() and then do the check:
tolist()
my_list = [[1,1], [2,2]] print(np.array([1,1]).tolist() in my_list) print(np.array([1,2]).tolist() in my_list)