Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by est

12 hours ago

I think py version can be shortened as:

from collections import Counter

stats = Counter(x.strip() for l in open(sys.argv[1]) for x in l)

2 comments

est

Reply

voidUpdate  12 hours ago

Would that decrease memory usage though?

  • est  6 hours ago

    see https://news.ycombinator.com/item?id=47543756

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities