I have a dataframe which has two columns. Each column has comma separated string. I am trying to convert this string into list and hence I can subtract two lists as a_b = list(set(a) - set(b)) for each row for the following dataset.
Col1 Col2
a,b,c,f d,f,g
d,g w,a,d
f,g,h f,g,h
I tried converting items into list as below
df1['Col1']tolist()
But it doesn't seem to work. Thanks.
str.split:df['Col1'].str.split(',')