I have a 227x4 DataFrame with country names and numerical values to clean (wrangle ?).
Here\'s an abstraction of the DataFrame:
import pandas as pd i
Use numeric with errors coerce i.e
cols = ['Measure1','Measure2'] df[cols] = df[cols].apply(pd.to_numeric,errors='coerce')
Country Name Measure1 Measure2 0 PuB 7.0 6.0 1 JHq 2.0 NaN 2 opE 4.0 3.0 3 pxl 3.0 6.0 4 ouP NaN 4.0 5 qZR 4.0 6.0