Skip to content
Advertisement

Check if a value exists in pandas dataframe index

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 or False to see if a value exists in pandas df index.

JavaScript

What I have working now is the following

JavaScript

Advertisement

Answer

This should do the trick

JavaScript
Advertisement