From the course: Python for Marketing
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Plot cost-per-click marketing data - Python Tutorial
From the course: Python for Marketing
Plot cost-per-click marketing data
- Looking to take control of your advertising expenses? Visualizing cost per click, or CPC data, is the key to evaluating your advertising costs and optimizing your budget decisions. In this lesson, I'll be showing you how to plot cost-per-click data in Python using pandas and Matplotlib. Start by opening up plot_cpc_data.ipynb to follow along. This notebook has the relevant libraries imported and cpc_data.csv loaded into a DataFrame. This dataset contains cost per click or CPC data across time. Your goal is to visualize cost by creating three plots overlaid, comparing the original data, which is measured at a daily interval, against weekly, resampled averages and against weekly rolling averages. Start by resampling the data by week and taking the average. Call .resample and pass in capital W as a string, followed by .mean. Now create a rolling seven-day window. Call .rolling and pass in window = 7 and center = True, followed by .mean. Next, create a data visualization that plots the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Find value of time series data in marketing1m 58s
-
(Locked)
Prepare the times series data for analysis4m 26s
-
(Locked)
Resample the time series data3m
-
(Locked)
Create a rolling average plot for time-series marketing data3m 2s
-
(Locked)
Plot cost-per-click marketing data3m 25s
-
(Locked)
Add dynamic annotations4m 1s
-
(Locked)
-
-
-