ECON 3209 · Week 6, Lecture 3 · Kerala Agricultural University
Autumn 2026
"1,250" instead of numeric values.Rice, rice, and Paddy.isna().sum().A good cleaning script is a transparent record of decisions, not just a shortcut to a neat table.
Create a DataFrame with one missing value, one text-formatted number, and one inconsistent crop label. Write code to standardise the crop names, convert the numeric column properly, and drop rows with missing output.
pd.to_numeric() and string methods are basic cleaning tools in pandas.ECON 3209 — Kerala Agricultural University