From the course: Python for Marketing (2019)

Unlock this course with a free trial

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

Calculating two date ranges

Calculating two date ranges - Python Tutorial

From the course: Python for Marketing (2019)

Calculating two date ranges

- [Instructor] In this task of building help from earlier, we're going to want to look at date ranges. We want to set the date range for a specific frame of data we're going to look at. And then we want the layers to tell us if anything has changed. So to do that, first we need to create date ranges and be able to look those up, and then look at the difference of those date ranges. To do that, we create a couple of variables, so start and end, so these are the start dates and the end dates, if I run that, nothing wrong should happen. And we want to create a thing called a mask. A mask is essentially going to be a filter and we'll apply this mask to data. So what we are going to filter is we are looking at GA page traffic data index equal to start or GA page traffic data equal to end. So what that'll do is it'll give us the data for that date that we've supplied and the end date we supplied. What we get back is…

Contents