I have this table:
id | type | text |
---|---|---|
1 | inv_num | 123 |
1 | company | ASD |
1 | item | fruit |
1 | item | vegetable |
2 | inv_num | 123 |
2 | company | FOO |
2 | item | computer |
2 | item | mouse |
2 | item | headphones |
I would like to group the same types in one row in a list format:
id | type | text |
---|---|---|
1 | inv_num | 123 |
1 | company | ASD |
1 | item | ['fruit', 'vegetable'] |
2 | inv_num | 123 |
2 | company | FOO |
2 | item | ['computer', 'mouse', 'headphones'] |
Is it possible to do it using 'groupby'?