Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. Product Step
  2. 1 1
  3. 1 3
  4. 1 6
  5. 1 6
  6. 1 8
  7. 1 1
  8. 1 4
  9. 2 2
  10. 2 4
  11. 2 8
  12. 2 8
  13. 2 3
  14. 2 1
  15. 3 1
  16. 3 3
  17. 3 6
  18. 3 6
  19. 3 8
  20. 3 1
  21. 3 4
  22.  
  23. import pandas as pd
  24. sid = pd.DataFrame(data.groupby('Product').apply(lambda x: x['Step'].unique())).reset_index()
  25.  
  26. Product 0
  27. 0 1 [1 3 6 8 4]
  28. 1 2 [2 4 8 3 1]
  29. 2 3 [1 3 6 8 4]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement