I have a list of lists:
list1 = [['This','could','be','heaven'] ,['This','could','be','hell'],['heaven','or','hell','i','like','it']]
I want to produce an ordered dictionary of word frequency where the word is the key and the value is the number of times it occurred in the entire list e.g.:
{'could': 2, 'hell':2, 'this':2,'be':2,'heaven':2,'like':1,'i':1,'it':1,'or':1}
I think I should be using set() + count() + dictionary comprehension; something like this:
res = {idx : list1[idx] for idx in set(list1)}
print(res)
I know I should be able to do it one line but I need some help