Use get_loc
. From documentation:
Get integer location, slice or boolean mask for requested label.
>>> x.index.get_loc('b')
1
Use get_loc
. From documentation:
Get integer location, slice or boolean mask for requested label.
>>> x.index.get_loc('b')
1