I am using pandas groupby and want to apply the function to make a set from the items in the group.
The following results in TypeError: \'type\' object is not i
TypeError: \'type\' object is not i
Try using:
df = df.groupby('col1')['col2'].agg({'size': len, 'set': lambda x: set(x)})
Works for me.