 Q is a really cool package I stumbled across the other day. If you've seen some of my previous videos, I've covered a few. Command line data wrangler tools like Miller and XSV. Q is something similar, but it uses SQL like syntax. You can run Q on one CSV or multiple CSVs and write SQL just like you would in a SQL database. So in the examples on their GitHub page, you'll see Q and then a select statement on a CSV. So to get started, I'm just going to go to the Debian package and download that. To do that, I'm just going to copy the link and head over to Blink. Here, I'm just running Wget and downloading that .deb file. And that's then you'll see that Q is not found. You have to run dpackage, install, and then the name of the file. Run sudo with dpackage, install. Now when we run Q, we'll see that we have a version for Q and we can start working with it. So for Q to work, you need a CSV file. I'm going to download the diamonds data set. Again, Wget and then the link to the file, the raw file. So now that we have diamonds.csv, we should be able to run a Q command. So Q has a nice documentation page. You can scroll through and see some of the example queries. So to run a Q command, what you have to do is you have to run these flags. H, O, D, and then a comma. The H means that your CSV has a header file. O means that when you output, you want to keep that header file output. The D specifies the delimiter. Here, this is comma delimited. So you do D, space, comma, and then you can run your Q statement. So for standard CSV files that have headers and you want to output a header and it's comma delimited, this is a flag. So Q dash H, O, D, comma, and then your SQL statement and quotes. So this is a simple select star from diamonds limit 10. Again, we are going to run a filter on it, a where statement, and we should see that the output satisfies this where statement. So I'm going to make this a little bit more realistic and install Tmux so I can have visit data in one Tmux session and my terminal to do a Q command in another Tmux session. So to install visit data, it's sudo apt install. I made a mistake of typing VD. VD is a command you run to open visit data. So VD diamonds dot CSV, this is the diamonds data set. Now we can look at this data set and go back and forth between the data and my Q statement. To go back and forth between Tmux panes, it is control B and that's what I do. Control B and I think N means next. At least that's what I've made it up to be in my mind to remember it. So what I'm going to do is I'm going to select the average price for a specific group and I can just go back and forth to make sure I'm selecting the group I want to select and there it is, average price. I'm just going to go ahead and add the cut column so you can see which cut the diamond is and the average price for that cut. Maybe I don't want to look at cut. I can look at carrot and let's change that first column to carrot also. There we go. For each carrot, you can see the average price. So this was just scratching the surface with Q. Of course, this is a terminal command. You'll see an example in their documentation where they pass process information, PS and pipe it to Q. And so you can pipe any system information to Q. It's a very well thought out command line utility. And I think it's a useful tool that data scientists can reach for for doing some really great data manipulation in a reproducible way. Thanks for watching.