I have a DataFrame df1 that looks like this:
df1
A B C ----------------- 1 1 2 2 2 3 5 4 9 >
A B C ----------------- 1 1 2 2 2 3 5 4 9
In [88]: df.stack().groupby(level=0).apply(lambda x: x.unique().tolist()) Out[88]: 0 [1, 2] 1 [2, 3] 2 [5, 4, 9] dtype: object