Data cleaning prepares messy data for model training. A practical first step is checking which columns contain missing values, then deciding how to handle them. section 13.0 section 13.2
raw_data.isna().sum() Output: PassengerId 0 Survived 0 Pclass 0 Name 0 Sex 0 Age 177 SibSp 0 Parch 0 Ticket 0 Fare 0 Cabin 687 Embarked 2
The missing-value counts help guide decisions about which columns to drop or fill. section 13.2
For the Titanic dataset, the missing-value counts inform these treatments:
- Drop Cabin, which is missing 687 values. section 13.2
- Fill missing Age values with the column median; 177 values are missing. section 13.2
- Fill the two missing Embarked values with 'U'. section 13.2
These choices depend on the dataset and the problem being solved. After cleaning, the data can be saved for later model training. section 13.0 section 13.2













