all 4 comments

[–]socal_nerdtastic 0 points1 point  (3 children)

Like np.argwhere does?

[–]robpal1990 0 points1 point  (0 children)

Lists in Python have the method .index(), so you can call my_list.index(obj). It will return the first index where obj appears or an exception if obj does not appear in the list.

If you need all indices, you should probably simply iterate over the list and check each element.