Setting up our data to visualize daily conversion

When you want to understand how your campaign performed, it is essential to look at how key metrics changed throughout the campaign. Your key metrics can help you catch problems that may have happened during the campaign, such as a bug in the checkout system that led to a dip in conversion toward the end of your campaign. Metrics over time can also surface trends like gaining more subscribers over the weekends or on specific holidays.

In this exercise, you will build upon the daily conversion rate Series daily_conversion_rates you built in a previous exercise. Before you can begin visualizing, you need to transform your data into an easier format to use with pandas and matplotlib.

This exercise is part of the course

Analyzing Marketing Campaigns with pandas

View Course

Exercise instructions

  • Reset the index of the daily_conversion_rates Series and use pd.DataFrame() to convert the results into a DataFrame named daily_conversion_rate.
  • Rename the columns in the new DataFrame daily_conversion_rate to be 'date_served' and 'conversion_rate'.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Reset index to turn the results into a DataFrame
daily_conversion_rate = ____(daily_conversion_rates.____(____))

# Rename columns
daily_conversion_rate.____ = ['____', 
                              '____']