Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. df["unique_products"] = df.groupby("customer_id").agg({"products": "unique"})
  2.  
  3. # Transform each element -> row - Pandas >= 0.25
  4. df["unique_products"].explode()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement