Hello in this lecture we're going to learn how to filter our data base.
Are you using SAP.
That's I'm going to use the same set five demographic features there that contained information about
a group of car owners I have already created a new data frame more based on this find.
You may remember it from the previous lecture and you date a great deal more to be created each time
we run the filtering operation that the part that we want to keep the marriage objet all the we will
we will use one filter variable the top that looks this way.
So first we have to specify the date of Grame we want to filter in OK it's D-Mo. and then our filtering
condition after Cova.
So the variable marital which has two categories married and married has to be equal we married.
Please don't forget to put to two was here because it's a condition of equality.
OK.
So this will keep all of the marriage subjects that varify control counter.
And now let's see our new date of Graeme D-Mo. to Argonaut is here in the column marital on the marriage
subject.
Archean this data.
Okay.
Now let's suppose that we are interested in the married objects age old work 35.
So we are going to use to filter valve all this time the soft fountain looks the same.
So first we specify the date or frame D-Mo. and then our filtering conditions merit all must to be equal
must be equal with marriage and age must be greater than thirty five.
And of course we with the ampersand sign here let's see what happens.
Ron and view the new data Ray do more to as you can see here in these two columns only the marriage
people were retained and all of them have the age over 35 as we requested
Now if you want to drop it.
Sorry if you want to keep only the first three very eyeballs with the same with the same conditions
with the same filtering criteria.
So we want to keep all the vavle age marital status and incom what how do we proceed.
Opta petrifying is the a great deal more and the conditioner's marital equal to marriage and age greater
than 35.
We use the lax foundation in order to specify what columns what variables do we need.
And here we arrive to lacked equal to the infancy concatenate.
And here we fatha by the column 1 2 and 3 from that then you the data frame you see only the first three
columns were kept in our new data frame D-Mo. to.
And finally if you wanted to drop some variables for example drop the variables for 5 6 and 8.
That means education car prize car category and the retired
in the same way Octa satisfying the softer function the data frame and the conditions the conditions
marriage are equal to married and age over thirty five you use the same function and here before that
concatenates Ponson you put a negative because you want to drop to remove these variables.
So what variables you want to drop 5:56 and age.
That's right.
Now all you barabar D-Mo. to lose like this.
Only the married subject over 35 years.
What kept and only the variable age marital income and gender are in the new data frame as we requested
the bulk of the latter.
Thank you.