 In this video I want to show you how to do reductions. Now you might not use that word very often when you deal with tables or you deal with the data analysis, but reductions. Let me show you what this is all about. I'm going to hit escape in this cell. It'll turn blue. I'm going to use the keyboard shortcut M to change it into a markdown cell. Enter or return. Just to get it back to green. Two of those little pound signs, hash signs. Let's do reductions. Shift enter, shift return. Let's go. Let's just remind ourselves what table two was all about. Table two. That's better. And we remembered the primary key ID, group HPWCC. And what if I wanted to know what the sum total of all the values, say for instance in this last column was WCC. I want to know if I were to add all of these. It might be easy if there were just a few, but if there were thousands and thousands of rows, that'd be a bit difficult. So let's use the reduce function. Reduce. Open close parentheses. The first argument is what we want to do. I want to add all of these. And remember these operators such as plus, they are actually functions inside of Julia. They're really first class citizens. So I can just use the plus sign there. It just says add all of the values. And I'm going to reference table two as the object in which I want all of this to occur. And then I'm going to use the select keyword argument select. And what I want to select is this WCC column. And I'm using the symbol notation. In other words, colon WCC for that column name, shift and enter, shift return. And it adds up for me all the values there inside of this WCC column. It's going to just add all of them and give me the result there. That's quite easy to do. Let's do something slightly more useful. What if I wanted to look down that column and imagine, again, it's hundreds and hundreds of rows, thousands of rows. I want to know what the minimum and what the maximum value is. Reduce once again. So this time I want two things to happen. So I'm going to put them for this reduce function inside of its own set of parentheses. And I'm just going to use the min and max functions there. Once again, I'm going to say look at table two for me, please. Table two and select, select equals symbol notation WCC. Shift enter, shift return. And it really neatly finds it for me. It says the minimum value was 8.8 and the maximum value was 16.6. Now let's ramp this up a bit and make this really useful. Remember, we imported online stats, the online stats package. Now that has nothing to do with being online. It's just online stats. We'll have a look a little bit later. So I'm going to say reduce. And what I want here, and again, I'm going to put those inside of its own set of parentheses. I want the mean and that is a function. So I'm just going to use the open and close parentheses there. And I want the variance, open and close parentheses. And once again, I want this to be on the object in table two, the computer variable table two. And I'm going to select once again, the white cell count WCC, shift enter, shift return. And now the online stats package kicks in gives me this very nice output here. And I haven't done anything specifically. So it's giving me equal weights to each of these elements inside of my list. So and it also says number of observations 10, there were indeed 10 observations in each of in the WCC column. So I see a mean of 12.76. And I see a variance of 7.08. Remember, that's the square of the standard deviation. So very easy just to get out a bit of information by using the reduce function.