Drop vs Fill: Choosing Wisely
When to remove and when to impute.
Two Roads at a Gap
When you meet missing data, you face one big choice: drop the affected rows, or fill them in. The right road depends on how much you lose either way. 🛣️
Dropping Rows
The method dropna() removes any row that has at least one missing value. It is clean and simple, but it can quietly delete a lot of data.
clean = df.dropna()All lessons in this course
- Find the NaNs Hiding in Your Table
- Drop vs Fill: Choosing Wisely
- Impute With Mean, Median, or Mode
- Fix dtypes and Duplicate Rows