AnalystPath

Clean-Rated Audiobooks Aired in March

PandasEasyJunior level~10 min

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.

schedule
air_timeep_idstation
2021-03-10 08:001Wave-FM
2021-02-11 12:002Wave-FM
2021-02-12 12:003Wave-FM
2021-02-13 14:004Kids-Air
2021-03-18 14:004Kids-Air
catalog
ep_idep_titlefamily_safeformat
1Market WatchNAudiobook
2Tales for CubsYPodcast
3Query SchoolNPodcast
4Brave VoyageYAudiobook
5Glass SlipperYAudiobook

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 schedule

Solve 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

Related Pandas questions