我有一个包含一列列表的数据框,如下所示:
df
pos_tag
0 ['Noun','verb','adjective']
1 ['Noun','verb']
2 ['verb','adjective']
3 ['Noun','adverb']
...
我想得到的是每个唯一元素作为字典出现在整个列中的次数:
desired output:
my_dict = {'Noun':3, 'verb':3, 'adjective':2, 'adverb':1}
慕运维8079593
ABOUTYOU
相关分类