The df.Code column is always a 3-character string formed by 1 letter and 2 digits. I need to extract the digits (as int) to a new column lets say Code_Int. So “A03” will be 3, “W12” will be 12 and so on. This column has 180000 records with this exact pattern.
I have no clue how to do it. I tried getindex.(string(df.Code), Ref(1:3)) but didnt. work. Any help?
i create a new column insertcols!(df,4,:seed_int=>0) then your suggestion as df[:seed_int]=[parse(Int64,x) for x in df[!,:Code] and i get "ArgumentError: Invalid base 10 digit ‘W’ in “W10”
btw: “W10” is the first code in the original df.