【发布时间】:2015-04-27 18:11:22
【问题描述】:
我在 Pandas 数据框中的一列中有文本评论,我想用它们的频率计数来计算 N 个最常见的单词(在整个列中 - 不是在单个单元格中)。一种方法是使用计数器通过遍历每一行来计算单词。有更好的选择吗?
代表性数据。
0 a heartening tale of small victories and endu
1 no sophomore slump for director sam mendes w
2 if you are an actor who can relate to the sea
3 it's this memory-as-identity obviation that g
4 boyd's screenplay ( co-written with guardian
【问题讨论】:
-
将数据发布为表格而不是图像通常会有所帮助。
-
感谢 John 的建议,我确实尝试使用 html 制作有问题的表格,但它不起作用,所以我懒洋洋地发布了一张图片:(。
-
数据不必总是完整的。在大多数情况下,您需要有代表性的数据。
-
谢谢@JohnGalt 我明白了,下次我会更好地提出我的问题。