9

Missing Data

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.

Learning Objectives

  • Identify how missing values are represented in pandas

  • Recognize potential ways data can go missing in data processing

  • Use different functions to fill in missing values

9.1 What Is a NaN Value?

The NaN value in Pandas comes from numpy. Missing values may be used or displayed in a few ways in Pandas — NaN, NAN, or nan— they are all the same in terms of how you ...

Get Pandas for Everyone: Python Data Analysis, 2nd 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.