I am trying to use drop_duplicates on a column of a dataframe,
drop_duplicates
dataframe
A len [\'1\', \'2\'] 2 [\'1\', \'2\'] 2 [\'3\'] 1 [\'4\',
You need tuple:
tuple
df['A'].apply(tuple)
So use duplicated with boolean indexing:
df = df[~df['A'].apply(tuple).duplicated()] print (df) A len 0 [1, 2] 2 2 [3] 1 3 [4, 5] 2