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.

Rebuilding Google Analytics data

Rebuilding Google Analytics data - Python Tutorial

From the course: Python for Marketing (2019)

Rebuilding Google Analytics data

- Okay, in this video we are going to rebuild the Google Analytics data frame. It will not contain duplicate indexes and all of the data will be in the proper date format or numerical format that we need for doing analysis on it. To do this, we're going to use a pandas function called merge, so pd.merge, and we're storing pd.merge in new_ga. First, the left data set is the Google Analytics average time on page. Then the right data set is the combination of exit pages, bounce, and page value. That is left and right. We are going to join using an interjoin, and what this will do is it will look inside the index and it will look for matching values. Anything that isn't a matching value gets disregarded. So if in one data frame we have merge#quotaUK/nick, and the other data frame, we don't have that, then the other data frame's data will get dropped. Then we're going to merge left on page and right on page. Essentially what…

Contents