Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ribit
on July 24, 2022
|
parent
|
context
|
favorite
| on:
Performance comparison: counting words in Python, ...
These days I tend to use R for these type problems. It’s slow, but vectors as first-class data types simplify things a lot
readLines(file) |> strsplit(“ +”) |> unlist() |> table() |> sort(desc = TRUE)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
readLines(file) |> strsplit(“ +”) |> unlist() |> table() |> sort(desc = TRUE)