If you want to filter a pandas DataFrame based on the index’s name, you can use either filter or loc.
filter
loc
My previous tips on pandas.