Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
fiddlerwoaroof
on March 7, 2019
|
parent
|
context
|
favorite
| on:
Seven Unix Commands Every Data Scientist Should Kn...
I do something like:
< foo.csv (read -r head; echo “$head”; shuf -n 50)
If you do this a lot, you could combine the read/echo into a single shell function.
eesmith
on March 8, 2019
[–]
Or write a Python program. But a quick test shows that CPython (using a pure Python reservoir sampling) is 1/4th the speed of shuf.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: