Hi, (I wrote the article). A few people commented noting that I included "Data Science" in the title, but the content doesn't include any statistics or machine learning which is closer to the core definition of 'data science'. I still think the title is appropriate since any kind of low-fidelity data science task you do on some had-hoc data (log files, heaps of text, web pages) is going to start with setting up a pro…
An introduction to data processing on the Linux command line
51–60 of 73 posts
Re: An introduction to data processing on the Linux command line
#52Hi, (I wrote the article). A few people commented noting that I included "Data Science" in the title, but the content doesn't include any statistics or machine learning which is closer to the core definition of 'data science'. I still think the title is appropriate since any kind of low-fidelity data science task you do on some had-hoc data (log files, heaps of text, web pages) is going to start with setting up a pro…
Re: An introduction to data processing on the Linux command line
#53Earlier quoted context omitted.
hah, I knew someone would point that out (which is why I talked about it in the article). I actually prefer useless cat because when you're prototyping a pipeline it's very awkward to use non-useless cat. You'll probably start off with something like this to observe the content of the file: cat something.txt Using this doesn't work in bash: Then, continuing with useless cat to build on it you do cat something.txt | g…
If you’re working with a lot of data you probably want to pipe it into head anyway, initially, so Can be the starting command. When you no longer need the head there, just get rid of “head |”. Although I agree that the pointing out of “useless cat” is usually not particularly useful or constructive.
Re: An introduction to data processing on the Linux command line
#54Hi, (I wrote the article). A few people commented noting that I included "Data Science" in the title, but the content doesn't include any statistics or machine learning which is closer to the core definition of 'data science'. I still think the title is appropriate since any kind of low-fidelity data science task you do on some had-hoc data (log files, heaps of text, web pages) is going to start with setting up a pro…
My pet peeve is the "grep | awk" idiom. No, just use awk.
Awk does map/reduce, relational joins, associative memory, table lookup, and so on. Just use awk arrays, begin block, and end block.
Re: An introduction to data processing on the Linux command line
#55Not really where the author is heading, but I like to configure a backend for mathplot lib to render graphics in a terminal so when I am SSHed to a remote system I can get inlined plots.
Shameless plug: https://github.com/csdvrx/sixel-gnuplot
Re: An introduction to data processing on the Linux command line
#56Here are some ways you could simplify some of the tasks in the article, saving on typing: cat data.csv | sed 's/"//g' can be simplified by doing this instead: cat data.csv | tr d '"' This awk command: cat sales.csv | awk -F',' '{print $1}' | sort | uniq Can be replaced with a simpler (IMO) cut instead: cat sales.csv | cut -d , -f 1 | sort | uniq When using head or tail like this: head -n 3 You don't need the -n: head…
Ex: | sed -e step1 becomes | sed -e step1 -e step2 instead of adding another pipe and another "moving part" like tr
Re: An introduction to data processing on the Linux command line
#57This is a little more awk-ish: awk -F, '$2 == "F" {$0=(($1-32)*5/9)",C"} {print}'
Re: An introduction to data processing on the Linux command line
#58Hi, (I wrote the article). A few people commented noting that I included "Data Science" in the title, but the content doesn't include any statistics or machine learning which is closer to the core definition of 'data science'. I still think the title is appropriate since any kind of low-fidelity data science task you do on some had-hoc data (log files, heaps of text, web pages) is going to start with setting up a pro…
Much can be done just with awk. My pet peeve is the "grep | awk" idiom. No, just use awk. Awk does map/reduce, relational joins, associative memory, table lookup, and so on. Just use awk arrays, begin block, and end block.
But most people don't know awk. And awk requires more awareness. I break my awk when I fix things when tired.
Re: An introduction to data processing on the Linux command line
#59Earlier quoted context omitted.
> Why people use Linux in place of nix ? I find it more irritating when people try to score greybeard points by saying *nix (or Unix) when it's obvious that they're talking about a Linux-only mechanism and quite possibly haven't ever used Unix (or a direct derivative).
Huh? What is specific to Linux in this post? Also, the most popular Unix-like OS (far more than Linux) is macOS, basically the least “leet greybeard affectation” thing I can imagine. Your irritation is way off base.
Perhaps nothing? I was responding to the complaint in general terms.
> Your irritation is way off base.
Please allow me to feel irritated when people refer to obvious Linux things as something that's supposedly got something to do with Unix. It happens often enough.
Re: An introduction to data processing on the Linux command line
#60Here are some ways you could simplify some of the tasks in the article, saving on typing: cat data.csv | sed 's/"//g' can be simplified by doing this instead: cat data.csv | tr d '"' This awk command: cat sales.csv | awk -F',' '{print $1}' | sort | uniq Can be replaced with a simpler (IMO) cut instead: cat sales.csv | cut -d , -f 1 | sort | uniq When using head or tail like this: head -n 3 You don't need the -n: head…
sort -u -t, sales.csv
However, those fail with quoted commas.
Also, head -3 is non-POSIX obsolete syntax.
Edit: I don't know why I didn't see other UUOC references initially.