Given a raw dataset with missing values and inconsistent formatting, write a Python script to clean and prepare it for training.