I have a data frame that contains a column with comma separated values. I would like to convert the string values in that column to integers.
I am newish to coding in general so a brief explanation of what is happening would be massively appreciated. If you have time.
I have tried the following code.
df['col3'].str.strip(',').astype(int)
df
col1 col2 col3
1 x 12,123
2 x 1,123
3 y 45,998
df
col1 col2 col3
1 x 12123
2 x 1123
3 y 45998