Let's say I have the following multi-index DataFrame:
import pandas as pd
df = pd.DataFrame({'Index0':[0,1,2,3,4,5],'Index1':[100,200,300,400,500,600],'A':[5,2,5,8,1,2]})
Now I want to select all the rows where Index1 is less than 400. Everybody knows how that works if Index1 was a regular column:
df[df['Index1'] < 400]
So one method would be to reset_index, perform the selection, then set the index again. This seems quite redundant.
My question is: Is there a way to do this directly? And how to do this when the DataFrame has a row multiindex?

df.set_index(['Index0','Index1'])in the code.