Clean-Rated Audiobooks Aired in March
Problem
An audio streaming service stores a broadcast schedule and a catalog of episodes.
`schedule` columns:
- `air_time` - when an episode aired (a timestamp)
- `ep_id` - the episode that aired
- `station` - the station it aired on
`catalog` columns:
- `ep_id` - episode identifier
- `ep_title` - episode title
- `family_safe` - 'Y' or 'N'
- `format` - one of 'Audiobook', 'Podcast', etc.
Return the distinct titles of episodes that are family-safe ('Y'), are in the 'Audiobook' format, and aired at any point in March 2021. Name the column `ep_title`.
Input data
Example rows — the live problem includes the full dataset.
| air_time | ep_id | station |
|---|---|---|
| 2021-03-10 08:00 | 1 | Wave-FM |
| 2021-02-11 12:00 | 2 | Wave-FM |
| 2021-02-12 12:00 | 3 | Wave-FM |
| 2021-02-13 14:00 | 4 | Kids-Air |
| 2021-03-18 14:00 | 4 | Kids-Air |
| ep_id | ep_title | family_safe | format |
|---|---|---|---|
| 1 | Market Watch | N | Audiobook |
| 2 | Tales for Cubs | Y | Podcast |
| 3 | Query School | N | Podcast |
| 4 | Brave Voyage | Y | Audiobook |
| 5 | Glass Slipper | Y | Audiobook |
Expected output
Your answer should return 1 row with the columns ep_title.
Starter code (Pandas (Python))
import pandas as pd
def clean_rated_audiobooks_aired_in_march(schedule, catalog) -> pd.DataFrame:
# Your code here
return scheduleSolve this Pandas question free
Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock