5. Missing Data

5.1 Introduction

Rarely will you be given a data set without any missing values. There are many representations of missing data. In databases, they are NULL values; certain programming languages use NA; and depending on where you get your data, missing values can be an empty string, '', or even numeric values such as 88 or 99. Pandas displays missing values as NaN.

Concept Map

1. Prior knowledge

a. importing libraries

b. slicing and indexing data

c. using functions and methods

d. using function parameters

Objectives

This chapter will cover:

1. What a missing value is

2. How missing values are created

3. How to recode and make calculations with missing values

5.2 What Is a NaN Value?

The NaN value in Pandas comes from

Get Pandas for Everyone: Python Data Analysis, First Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.