I have a pandas series containing lists of tokens of strings. I want to find common elements among all the lists and along with their count (it must not be unique, bring all the elements with its count across the series). what I am currently doing is making a dictionary from pandas series and counting frequency of terms
ham_tokens = {}
for l in df_ham.tokens:
for t in l:
if ham_tokens.get(t):
ham_tokens[t]+=1
else:
ham_tokens[t]=1
here is snapshot of my data
0 [we, have, difficulties, delivering, your, EMOTION, no, due, to, unpaid, shipping, freight, htpps, cuidaragora, php]
1 [costcoreward, your, EMOTION, cash, back, has, been, remunerated, sorry, for, the, delay, click]
2 [your, civil, verdict, has, been, finaiized, get, your, payment, by, URLBRAND, juristalawll, bch]
3 [need, quick, cash, get, up, to, cash, loan, in, minutes, no, credit, needed, same, day, funding, apply, now, reply, stop, to, remove]
4 [authmsg, BRAND, verification, is, dont, share, to, anyone, else, EMOTION, id, account, cannot, access, rightnow, bit, ly]
what I need is the a pandas method or any other efficient(loop-less) which can handle this problem.