假设我有一个熊猫数据帧,它看起来像这样的事情:熊猫:如何计算每一行中各个单词的数据帧
sentences
['this', 'is', 'a', 'sentence', 'and', 'this', 'one', 'as', 'well']
['this', 'is', 'another', 'sentence', 'and', 'this', 'sentence', 'looks', 'like', 'other', 'sentences']
我试图计算每个每个单词的计数行,并以一种我可以在需要时轻松使用它的方式存储它们。到目前为止,我失败了,我会很感激一些帮助。
谢谢!
您是否尝试过使用df.column_name [。 value_counts()](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html)? – Tbaki