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.
Importing Google Analytics data - Python Tutorial
From the course: Python for Marketing (2019)
Importing Google Analytics data
- [Instructor] Let's jump right into things. The libraries you need to have installed before using this notebook are pandas and pytrends. You import pandas as pd and pytrends, from pytrends.request import TrendReq. There's also a magic command in there, magic matplotlib.inline. This is what allows us to plot charts in the notebook. If I run this I get no errors and everything is good to go. The first thing I want to do here, is load in a Google Analytics CSV. So we will do this by creating a variable, you can name it whatever you like. I've named it ga_data and that equals pd, so that says calling pandas, we're looking up the function read_csv, and then we're telling read_csv where the CSV file is that we want it to read. If I run this we have no problems, and I want to inspect the data so I want to see the first five rows of the data. So we're going to use a function called .head, and as you can see, if you're used…
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
-
-
-
-
Introduction to pandas1m 7s
-
(Locked)
Installing Jupyter1m 30s
-
(Locked)
Importing Google Analytics data4m 48s
-
(Locked)
Importing Google Search Console data1m
-
(Locked)
Importing Facebook and AdWords data2m 29s
-
(Locked)
Accessing the Google Trends API2m 14s
-
(Locked)
Visualizing Google data2m 40s
-
(Locked)
Plotting Facebook and Google Ads data3m 18s
-
(Locked)
Visualizing Google Trends data1m 38s
-
-
-
-
-
-
-