Hi I am using the pandas/python and have a dataframe along the following lines:
21627 red
21627 green
21627 red
21627 blue
21627 purple
21628 yellow
21628 red
21628 green
21629 red
21629 red
Which I want to reduce to:
21627 red, green, blue, purple
21628 yellow, red, green
21629 red
Whats the best way of doing this (and collapsing all values in lists to unique values)?
Also, if I wanted to keep the redundancy:
21627 red, green, red, blue, purple
21628 yellow, red, green
21629 red, red
Whats the best way of achieving this?
Thanks in advance for any help.