I have dataframe which looks as this:
FIRST SECOND
1 a
1 b
1 c
1 b
2 a
2 k
3 r
3 r
3 r
And I need to get matrix as this, which represent count of repetition of each word for every number:
FIRST a b c k r
1 1 2 1 0 0
2 1 0 0 1 0
3 0 0 0 0 3
Can anyone help me with this? :)