Let's say I have the following dataframe:
id | id_2 | id_3 | text | integers |
---|---|---|---|---|
0 | 1 | 2 | lorem | integers1 |
0 | 1 | 2 | epsilon | integers2 |
0 | 1 | 2 | text3 | integers3 |
0 | 1 | 3 | text4 | integers4 |
My question is:
- How can we merge text columns given the condition id, id_2 and id_3 are the same. I mean, I want to extract the values from 'text' column separated by comma or space and respecting the condition that id=0,id_2=1 and id_3=2 Output wanted: 0 | 1 | 2 | lorem epsilon text3 | sum(integers1,integers2, integers3)
Thanks