I have a dataframe df like this where both columns are object.
+-----+--------------------+--------------------+
| id | col1 | col2 |
+-----+--------------------+--------------------+
| 1 | 0,1,4,0,1 | 1,2,4,0,0 |
+-----+--------------------+--------------------+
I convert them into a list like this
test = df["col1"]+','+df["col2"]
test.tolist()
Which produces the following results as a SINGLE STING element in a list
['0,1,4,0,1,1,2,4,0,0']
However, I want them as a list of integers like this
[0,1,4,0,1,1,2,4,0,0]
Any suggestions? Just FYI, the columns are really huge in my original dataset so performance might be an issue too.