Suppose I have a Pandas Index object. I want to find the integer index of an item in the index. For example:
index = pd.Index( [ 'a', 'b', 'c' ] )
print np.argmax( index=='b' )
>>> 2
However, my solution involves an O(n) lookup, whereas I think there should be a way to find a O(1) lookup as this is an index.