Code:
df_paths = df.groupby(\'cookie\')[\'channel\'].aggregate( lambda x: x.unique().tolist()).reset_index() df_last_interaction = df.dr