EvolutionCourse Hub
← Dictionary
Type conversion (coercion)

Also: to_numeric, astype

Python tools

Turning a column into another type. With errors='coerce', values that can't be converted become NaN instead of stopping the code.

Examplepd.to_numeric(df['TotalCharges'], errors='coerce') turns 11 blank spaces into NaN.