My df looks like this:
sent token token2
1 word1 word1
1 word2 word2
1 word3 word3
1 word4 word4
1 word5 word5
2 word6 word6
Now I want to get all possible combinations of tokens in a list if they have the same value for sent. The output should look like something like this:
[1, word1, word2, n]
[1, word1, word3, n]
[1, word1, word4, n]
[1, word1, word5, n]
[1, word2, word3, n]
...
I tried using itertools and crosstab consctructions but I can't seem to figure out how to add a condition to them.
n.. ?