I am sure there is an obvious way to do this but cant think of anything slick right now.
Basically instead of raising exception I would like to get True
True
This should do the trick
'g' in df.index