I have a series whose entries are sets. I want to remove all duplicate entries, using pandas.Series.drop_duplicates()
but get an error. Here is an example:
import pandas as pd
ser = pd.Series([{1,2,3}, {4,5,6}, {4,5,6}])
ser.drop_duplicates()
The last line gives the following exception:
TypeError: unhashable type: 'set'
Whereas I would like to get:
0 {1, 2, 3}
1 {4, 5, 6}
Is this a bug? Or is there another way to acheive this?