假設我有一個熊貓數據幀,它看起來像這樣的事情:熊貓:如何計算每一行中各個單詞的數據幀
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