From the course: Python for Marketing (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Rolling average plots

Rolling average plots

- [Instructor] Here we're going to look at resampling and rolling averages. Now, resampling will sample over a seven-day period, so Monday to Sunday, and rolling averages will take a seven-day window, so, for example, it will start on the first day to the seventh day, and it will take a sample at the midpoint there. Then it will take the second to eighth day and take a sample there, and third to ninth day and take a sample there, and then you can run your calculations on it. So they work slightly different. They're used for different analysis. Both are useful and both are good. It just depends what you're doing. But what we are going to do is locate cost per click weekly average data, and we're going to plot a resample and a rolling average with that. So if we look at the PPC data we've loaded in, so we stored the data frame as ppc_data.head, and we're going to use the cost column. The day is set as the index. If…

Contents