liveBook · Manning

Nan

As explained in Grokking Machine Learning

NaN is a special marker representing a value that is missing, undefined, or not representable as a numeric value.

NaN, or “not a number,” marks an entry that is missing, unreadable, or cannot be converted into a number. In a dataset, NaN values can prevent a model from fitting successfully. section 13.2

Missing cabin records

In the Titanic dataset, many Cabin entries are NaN: 687 of 891 values are missing. Because this feature is mostly empty, removing the column may be more useful than keeping it. section 13.2

How Grokking Machine Learning covers it

How deep it goes
Defines NaN, counts missing entries, and demonstrates dropping columns or filling values, without discussing numeric representation internals.
Examples
Uses Titanic Cabin, Age, and Embarked columns to demonstrate inspection, removal, median filling, and categorical filling.
What it assumes
Assumes familiarity with tabular datasets and columns while teaching missing-value cleanup through concrete examples.
What you can do after
Diagnose missing entries with isna() and choose whether to drop a feature or replace its NaN values.
How it connects
Connects NaN with missing values, data cleaning, feature selection, and model fitting.

Also explained in

Compare how 9 books explain nan →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Machine Learning. The section links point to the parts of the book it draws on.