I have the following list in python
texts = [
["great", "even", "for", "the", "non", "runner", "this", "sound",
"track", "was", "brilliant"],
["cannot", "recommend", "as", "a", "former", "comrade", "i", "did",
"not", "want", "to", "have", "to", "do", "this"]
]
and I want to go through the list and count how often each word appears in it.
I have tried counting the individual words using length()
and I get a 2
as a result which means it does not work.
Is there any way I can count how often a word appears in a list as I intend storing the counted word in a new list and it's frequency in another list.
Thanks in advance