Creating daily conversion rate DataFrame
To understand trends over time, you will create a new DataFrame that includes the conversion rate each day. You will follow essentially the same steps as before when you calculated the overall conversion rate, this time also grouping by the date a user subscribed.
Looking at the daily conversion rate is crucial to contextualize whether the conversion rate on a particular day was good or bad. Additionally, looking at conversion rate over time can help to surface trends such as a conversion rate that appears to be going down over time. These kinds of trends are crucial to identify for your marketing stakeholders as early as possible.
This exercise is part of the course
Analyzing Marketing Campaigns with pandas
Exercise instructions
- Group
marketing
by'date_served'
and calculate the unique number of user IDs. - Select only the rows in marketing where
converted
equalsTrue
. Group the result by'date_served'
and calculate the unique number of user IDs.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Group by date_served and count unique users
total = marketing.____(['____'])['____']\
.____()
# Group by date_served and calculate subscribers
subscribers = marketing[____['____'] == ____]\
.____(['____'])\
['____'].____()
# Calculate the conversion rate for all languages
daily_conversion_rates = subscribers/total