Re:Homogenization of scientific computing – Python is eating...
by jessaustin on Thursday January 09, 2014 @04:43PM
(#7033470)
GP asked for counts, not uniques.
[ Parent
| on HN ]
Re:Homogenization of scientific computing – Python is eating...
by yohanatan on Thursday January 09, 2014 @05:17PM
(#7033675)
Oops, you're right.
words = open("test.txt").read().split()
[(k, len(list(g))) for k, g in groupby(words, lambda x: x)]
Re:Homogenization of scientific computing – Python is eating...
by leephillips on Thursday January 09, 2014 @05:58PM
(#7033873)
Doesn't that require an "import itertools"?