1. 程式人生 > >pandas string格式轉成int,float

pandas string格式轉成int,float

如果y1的 amount列是string格式的
y1 = pd.to_numeric(y1.amount, errors=’ignore’ )/10000

errors=’coerce’, 會返回nan,these errors will be ignoredand pandas will convert problematic elements to pd.NaT (

errors=’ignore’, 會忽略錯誤保持原樣