boolean indexing on index (instead of dataframe)
I see two ways of getting this, both of which look like a detour – which makes me think there must be a better way which I'm overlooking.

Converting the MultiIndex into columns: df[df.reset_index()["B"] == 2]
Swapping the name I want to use to the start of the MultiIndex and then use lookup by index: df.swaplevel(0, "B").ix[2]
When I have a pandas.DataFrame df with columns ["A", "B", "C", "D"], I can filter it using constructions like df[df["B"] == 2].
How do I do the equivalent of df[df["B"] == 2], if B is the name of a level in a MultiIndex instead? (For example, obtained by df.groupby(["A", "B"]).mean() or df.setindex(["A", "B"]))