BuildlyBuildly
DashboardExercisesProfileHelp
Data Science/Module 3: Importing & Handling Files/CSV Cleanup2/3
Exercise·7 min·10 XP

Fix a Numeric Column

Context. A price column was read from CSV as text because the numbers contain thousands separators ("1,200"). You can't do math on it until it's numeric.

Your task. Write fix_price_column(df) that returns the DataFrame with the price column converted to integers — strip the commas first, then change the type.

Example. "1,200" → 1200, "980" → 980.

Notes. Only the price column changes. Every value is a clean integer once the commas are gone.

Previous
Tidy Column Headers
Next
Normalize Text Values