Missing values
Missing values, as the name suggests, are values we expect to have but we don't. In the simplest terms, missing values are empty cells in a dataset that we want to use for analytic goals. For example, the following screenshot shows an example of a dataset with missing values—the first and third students' grade point average (GPA) is missing, the fifth student's height is missing, and the sixth student's personality type is missing:
In Python, missing values are not presented with emptiness—they are presented via NaN
, which is short for Not a Number. While the literal meaning of Not a Number does not completely capture all the possible situations for which we have missing values, NaN
is used in Python whenever we have missing values.
The following screenshot shows a pandas DataFrame that has read and presented the table represented in Figure 11.1...