Premium problem59. Cross-Section from a MultiIndex

Medium Locked

df is indexed by (date, name). Return the subset of rows where name == "AAPL", across all dates, with the name level of the index dropped (so the result is indexed only by date).

Input

                  close
date       name        
2020-01-01 AAPL     100
           GOOGL    200
2020-01-02 AAPL     101
           GOOGL    202

Output

            close
date             
2020-01-01    100
2020-01-02    101

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)