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.
Replacing missing Facebook Ad data - Python Tutorial
From the course: Python for Marketing (2019)
Replacing missing Facebook Ad data
- This is going to be an incredibly quick tutorial, but I'm going to highlight a very very useful tool in the pandas toolkit. Whenever you get NANs, so not a number, these guys, you sometimes get them en masse, and they're all over a dataset, but you want to replace them. You can replace them using a function called "fillna," so it basically looks for NANs, or NaNs, and then replaces them with whatever value you give it. In this case, we're going to be really simplistic, and we're just going to fill the NA with a zero, but you could put a mean in there, you could put anything you like. You know your datasets, so you will be able to decide what the best fill value is. So once we have called "fillna," on the data frame, and passed zero as the fill option, and then in place, we will have overwritten that view of the data. Have a look ahead, there we go. Just like that, all these values cleaned up in one go. So that is how…
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)
Introduction to data wrangling44s
-
(Locked)
Fixing Google Analytics page data4m 17s
-
(Locked)
Preparing data to be grouped2m 39s
-
(Locked)
Creating new datasets with Groupby3m 18s
-
(Locked)
Rebuilding Google Analytics data3m 25s
-
(Locked)
Dropping columns2m 12s
-
(Locked)
Replacing missing Facebook Ad data1m 6s
-
(Locked)
Merging Google Analytics and Search Console1m 50s
-
(Locked)
Saving your data to a CSV46s
-
(Locked)
-
-
-
-
-