I'm trying to sort values in a dataframe and get it in a particular format but am having trouble getting that.
I have a dataframe
| Name | Operation | Status |
|---|---|---|
| Mark | Access Items | Successful |
| Cody | Copy data | Failed |
| Thea | Delete data | In Progress |
| Mark | Delete data | In Progress |
| Cody | Copy data | Successful |
I want to get a final dataframe:
| Name | Operation | Status |
|---|---|---|
| Mark | [Access Items, Delete data] | [Successful, In progress] |
| Cody | [Copy data, Copy data] | [Failed, Successful] |
| Thea | Delete data | In Progress |
I have tried to use
df.sort_values(by="Name")
but that does not help as I still get 6 rows instead of 3 rows where the operations are sorted by names
I have also tried
df.groupy(by = "Name")
But that creates a groupby object instead of a dataframe object and I don't know how to convert it back to a dataframe. It will be great if someone can help me, thanks!