my df
looks like this:
category text
-------- ----
soccer soccer game is good
soccer soccer game
basketball game basketball
basketball game
volleyball sport volleyball sport
What I want to do is groupby
category
and then list the words
by its frequency
category text frequency
-------- ---- ---------
soccer soccer 2
game 2
is 1
good 1
basketball game 2
basketball 1
volleyball sport 2
volleyball 1
what did I do?
- I group all the
text
together
df.groupby(['category])['text'].sum()
Now all the text are on the same rows
since I grouped it but I do not know how to do a Frequency Table using each word count.
Could someone please help me?