Guided Notes

Cleaning Wrong Formats, Wrong Data & Duplicates

Converting formats with to_datetime and to_numeric, fixing impossible values, and removing duplicates.

Data in the wrong format

Slide 1 / 5

A column is only useful if every value has the right type. Common problems:

β€’ Dates stored as text, some written differently ('2020/12/20' vs '20201226'). β€’ Numbers stored as text, with symbols ('$1,200'). β€’ Categories spelled inconsistently ('IT', 'it', 'I.T.').

Convert the whole column to the proper type; anything that can't be converted becomes missing, and you handle it like an empty cell.

← Cleaning Empty Cells