Conversion rate sensitivities
To mix things up, we will spend the next few exercises working with the conversion rate metric we explored in Chapter One. Specifically you will work to examine what that value becomes under different percentage lifts and look at how many more conversions per day this change would result in. First you will find the average number of paywall views and purchases that were made per day in our observed sample. Good luck!
Diese Übung ist Teil des Kurses
Customer Analytics and A/B Testing in Python
Anleitung zur Übung
- Merge the
paywall_viewswithdemographics_datatables using an'inner'join. This will limit the result to only include users who appear in both and will remove everyone who did not view a paywall, which is what we want in this scenario. - Group
purchase_databy'date'. The result of this is then aggregated for you by summing over thepurchasefield to find the total number of purchases and counting over it to find the total number of paywall views. - Average each of the resulting
sumandcountfields to find the average number of purchases and paywall views per day. - The results reflect a sample of 0.1% of our overall population for ease of use. Multiply each of
daily_purchasesanddaily_paywall_viewsby1000so our result reflects the magnitude change if we had been observing the entire population.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Merge and group the datasets
purchase_data = demographics_data.merge(paywall_views, how='____', on=['uid'])
purchase_data.date = purchase_data.date.dt.floor('d')
# Group and aggregate our combined dataset
daily_purchase_data = purchase_data.groupby(by=['____'], as_index=False)
daily_purchase_data = daily_purchase_data.agg({'purchase': ['sum', 'count']})
# Find the mean of each field and then multiply by 1000 to scale the result
daily_purchases = daily_purchase_data.purchase['sum'].____()
daily_paywall_views = daily_purchase_data.purchase['count'].____()
daily_purchases = daily_purchases * ____
daily_paywall_views = daily_paywall_views * ____
print(daily_purchases)
print(daily_paywall_views)