I have a MultiIndex Pandas dataframe which looks like this:
col1 col2 col3
a e m
b f n
g o
c h p
i q
d j r
k s
l t
The MultiIndex consists of col1 and col2.
How can I select the "rows" of col1 which hold exactly two index labels in col2?
I.e., I want:
col1 col2 col3
b f n
g o
c h p
i q