Now let's check out three other methods which might be helpful in case you want to isolate us and work
with it.
For instance for machine perhaps the first thing is you might want to get rid of it.
So sometimes there are duplicate duplicating a data set and you want to get rid of them.
And there's also a method within Penates which helps you to keep this to get rid of those.
So you do not need to write a complex for loop or anything.
You can simply use a method and get rid of those.
For instance when I take a look at my data Frank and this one I can see that for instance the name repeats
itself here on the right.
So yes going vessel and so on and so on and so on.
These names repeating themselves a lot of times.
So what I can do now is simply use my data frame here and simply drop all the case.
So how do you do this.
S&P that's quit today.
OK.
Let's say you have three in this case is equal to and I'm referring to you have two which was the data
frame before.
So this one here is what.
Let me just see it for all of us were upset.
And you that too.
Right.
So what I do now is I am copying my data from stored in the.
And now I will use to drop the keys or duplicate saw the three got drop on the score.
Deprecates and what I need to specify is the subset.
So this is like the drop in a and you specify a subset.
In this method.
And then to the specified in a list.
And for now I only want to refer to the Name column so I only specify the name here.
And I also want to specify is the keep.
So keep is equal to.
And now you can specify actually three types.
You can put in the first alast or false the first and last.
Simply do exactly what you do what they supposed to do.
If you skip the first then the simply means it drops all the deprecates but it keeps the first occurrence.
If you specify lost then it drops off the tickets but except for the last occurrence.
And if you keep simply false then it drops all the Dubnyk it's OK.
So in this case a false and I can run this press control center and then you can see now for my name's
column here before now only unique names remain so only one time.
Yes Goman vessel doesn't occur several times on one time.
It starts with 0 or the later years Gehlen vessels get dropped.
And that's the same needs the same case for all the other names.
So all those names G.P.A. are unique U.S. Guard vessels not the same as yours.
Thread of different names.
And this is a curse year exactly for those all of those.
OK.
And we can see that only 650 heroes remaining from these two hundred sixty two thousand four hundred
sixty six in this case.
So there are a lot of documents concerning the name column.
But of course we could also specify more than just one column.
We're simply type in a comma and refer to several close to one.
So that's dropped up a method which might be quite useful especially if you only want unique values.
And this to this method is really really helpful.
What else only.
Also want to add two more things.
When the unique method and the unique methods.
So the number of uniques and uniques.
So if I for instance do same here if I am referring to my data frame to again which is complete that
U3 has dropped those but if I'm now actually not because I did not specify that in place so he wanted
to keep this in place for year but that's referred to again let's be called the two dot at and run this
and you can see that here obviously here already get that Picketts year.
But if you want to have the unique values for instance what I could do is I could use the unique methods.
So I can simply type in here for instance Deif 2 and then I'm referring to a certain column and this
for instance the name column name and now say Dot unique unique Copernicus's and then press control
enter to run this.
And you can see that now I've got my array with unique values.
So in this case if you want to work with it even though they are not showing your sign but this array
only contains unique values for the main course.
The last method I want to show you is the new Niek methods.
So simply add additional And before that you need in order to get the number of unique tokens.
For instance if you take a look at the segment here we could simply enter a new line and simply refer
to two and let me just use segment column segment and now dot number of uniques so uniques in Munich
Juber and this is again.
And I can run this control center and I got 88.
So obviously I get 88 unique values within my segment.
And so far we only see once a year.
But if we simply take a look at the max then if we run of two for instance here and use segment begin
segments and now got Max and I print this and run this I can get 245 45 so obviously 88 unique alias
should be possible right.
So obviously this Conqueror's.
So that's it's for this part of the Niek functions which are really great as well as the supplicated
function which helps you get the drop or the deprecates and simply clean your data.
So thanks for watching and hopefully I'll see you in the next video.
Until then.
Best.