I have multiindex dataframe that looks like this:
value
year name
1921 Ah 40
1921 Ai 90
1922 Ah 100
1922 Ai 7
in which year and name are the indices. I want to select every row where the name Ai appears. I have tried df.loc[(:,'Ai')] and df.loc['Ai'] but both give errors. How do I index only using the name column?