Free trial conversion by plan

MediumSpotifydatesboolean logicgroupby mean· 20 XP

Every subscription starts with a free trial. A trial converts if the subscriber didn't cancel before the trial ended: either they never cancelled, or they cancelled after trial_ends_on.

From subscriptions.csv, store the conversion rate per plan, rounded to 3 decimals, as a Series.

Expected answer

Store your answer in result.

Hints, the later steps and the answer come with Pro.

import pandas as pd

subs = pd.read_csv("subscriptions.csv", parse_dates=["started_on", "trial_ends_on", "cancelled_on"])
result = ...