[MUSIC]
So next, we're going to inspect some columns of our data set.
So let me, let's inspect some
columns of the data set.
So let's take a look at it.
So if I type sf['Country'],
what it's gonna do is select a column country, and
since I don't do anything to it, I don't set it equal to anything.
It's just going to print it.
Now, it says United States, Canada, England, USA, Poland,
United States, Switzerland.
So, that's the whole column, but printed horizontally.
Now, let's look at another column.
So, for example, let's look at the column age, so, sf.age.
I'm just gonna look at it.
So I have, the column is 24, 23, 22, 23, 23, 22, 25.
Same one we did a visualization up here.
Now we can take the same column sf.age and do some computations on it.
So if you type .mean, it's not saying that column is a mean column,
but actually computing the mean of that column.
Which, the mean age is 23.142857, and so on.
Now, we can compute, for example the max age.
So, as of age, and let's see max.
And again you get 25, that's maximum age.
Now, this is some prequel stuff, but let's do more.
Let's create new columns.
In our SFrame.
So, when you're doing machine learning, often taking columns
and transforming them, creating new ones, this is called feature engineering.
We will do a bunch of those.
I'm gonna do now, a creation of a new column.
So, let's go back and print the SFrame, and
you see that there's a First Name column and there's a Last Name column.
There's no full name column.
Let's say you want to create a new full name column, it's pretty easy.
I wanna say sf, our SFrame of Full Name, so
there's gonna be a column called Full Name.
And what is that column equal to?
Well, it's just a concatenation of first name and last name.
And in Python, it's really easy to take strings and concatenate them together.
All you have to do is put a plus sign.
So we can do sf['Full Name'] is gonna be
the First Name column, so ['First Name'],
and then I'm gonna put a space between it, so
plus the space, plus the last name column.
So, Last Name.
Now, this is pretty cool.
I just create a new feature, new column,
called full name which is just the first name space last name.
It's very easy to do these things in Python,
especially if you don't have typos.
I see that this is Fist Name instead of First Name.
So, and there you go.
So, now if you go back and show the SFrame again,
you'll see there is a new column called Full Name has been placed at the end.
So Bob Smith is the first full name there.
Now, you can do all sorts of interesting things.
So, for example you could take the age column and
I'm not gonna create a new problem.
I'm just gonna do add 2 here to this age column.
And you'll see that it's just gonna add 2 to every element.
And so, you can do these kinds of operations.
For example, you can do age and
multiply it by the column age again.
Now what happens when you do that?
Age times age?
You're gonna get age squared in every element.
And you get 556, 529 and so on.
[MUSIC]