I'm trying to speed up a program I've written, and after importing cProfile, I see that one function takes up a massive bit of computation time.
It's this, which finds an numpy.ndarray in a list:
    def locate(arr, l ):
        for i in range(len(l)):
            if np.all(l[i] == arr):
                return i
        return -1
As the list can't be ordered etc, I can't see any way to avoid scanning the entire list. I have read some pieces on vectorisation, and I wanted to know if that could be applied here, or if there's any other way to speed this up?
Thanks
 
     
     
     
     
    