The next thing we are going to do is known as variable transformation.
If you don't notice that we have four different distance variables to represent the same information.
That is, we just want to get the effect of having employment hubs nearby this town.
And for that, we had having four different variables.
This is already presenting a single feature.
So we'll be transforming these four different variables into one single variable.
We can do it in multiple ways.
One of the ways is to use the maximum of all these four or we can to take the minimum of all this forward,
or we can take the average of these four.
Usually we have to do whatever makes more business sense.
Here we will be taking the average of these four distances to get one average distance value, which
we will use to represent the feature of employment activity near that particular town.
So to create that variable, we will right be if dollar average distance.
This video will get.
Some of those four divided by four.
So the taller dollar, this one plus the M dollar.
This to.
Misty.
And just for.
Divided by four.
Let's create this variable.
Now we'll click on DBI, a variable the does it.
You can see in the end.
We have another column.
You can see that the four point zero eight value is actually the average of those forward values in
this.
To add this to this three individual.
Now that we have this video being created, we have to delete the other four based variables from our
dataset.
To delete the four variables, we need to get that position in the dataset, so we need to find out
the location of Difford distance variables that we want to remove to find out the location of the variable.
If you bought over the name of that column, you can see that this is column number six.
This is column seven, eight, nine.
We want to remove columns six to nine.
While we are removing a column, we can create a new dataset just to ensure that when we delete the
variables, we do not accidentally delete these variables that we do not want to delete.
So let us create a new dataset once, which is D.F. to.
It will get all relisten, be it.
So it is D.F..
We'll start with square brackets.
The first parameter is for the rows.
We want all the rows, so we will not mention anything.
We will straightaway put a comma.
The second bedroom I that is columns.
We want to include we do not want to include column six to nine.
So we'll use a minus sign.
So it is minus six to minus nine.
Let's run this.
We could be off to No.
Just click on, be up to.
You can see that this one, this two, this three, just for all these four variables are now deleted
since we deleted the correct variables and B of two is the dataset, which we want to use.
We will assign deserve to to be if one that is D.F., so be F is equal to be of two.
Now you can see that B.F. has 15 variables instead of 20.
We can remove B of two by writing item and within records we will be off to.
So B of two is removed.
And we have the D variable, which has 16 variables.
Now, if you remember the three points that we know there, one point was to remove the bus terminal
where even.
To remove that variable, we will again go to the data set.
And find out the location of bus terminal variable, if I hold already hitting it tells me that it is
column number 13.
So I will go and read B.F. Gate.
D.F. Square Records, Gomaa, minus 30.
And this you can see now we have 15 variables just to confirm the flick again and check if I'm in a
little mood and it is.
So this is how we removed the variables that we do not want in a dataset.
I go back to the three points that we noted in the summary of edict of univariate analysis.
So we have handled the outliers by capping them in rainfall and and hard rooms.
We have handled the missing values by replacing them with the mean values in an ice bed.
And we have diluted this variable called Busted.
And we have also transformed before distance what he would do.
One common average distance variable and we'll remove those other for distance valuables in the coming
videos.
We will learn how to handle categorical variables.