fillna is a Pandas operation that replaces missing entries with a value you provide. It helps preserve useful columns instead of deleting them. section 13.2
A practical cleaning workflow is:
- Keep a useful column when only some values are missing. section 13.2
- Calculate a sensible replacement, such as the median for numeric data. section 13.2
Cleaning Titanic data
The Age column has 177 missing values among 891 rows. Replacing them with its median, 28, preserves the column. The two missing Embarked values become U. section 13.2

