Hey everyone.
So in this video we are going to cover the operations on us and we can see some inbuilt matters that
are given independence in Python.
So here I have mentioned some of these methods some we have already covered and the rest you will find
on any Web site like here geek for geeks good watching here many methods for pandas are given and therefore
the difference usually and you can check any of these and like drove that we have done and there are
many more here.
You can get any of these and just by clicking that one that will deliver you to that particular method
page.
From that you can have idea that how it works.
So here we have a method that we are going to call him out of these these methods because or discussed
without explaining them here.
You will understand better than I show you.
So first of all I need a data frame so let me do my own data frame X is equal to in that we do it directly
without defining any dictionary.
So here we have a data frame.
They are revealed in the dictionary do something like a and pass the values like One two three four
and 5.
Then we have an interdiction and at least two that is B and that is something like 20 34 B 50 and 1
value with the same amplitude.
So here we go with this one.
If you write X you will get this one so for these two methods that is index and columns we do not require
any parameters.
You just need X diode index and you will get only index every level there like beginning from zero and
there are five indexes and each step is one if you increase this step then that would be different.
Now after that one we have columns that is also simple one just write C O a luminous here and you will
get the columns.
That is a and b and their data type is object.
So that's how you can work with these two.
So they are not much important.
Now we have this one that is apply and some we have already done but still I want to show you like if
you want to some and you the value just boss that one and dot some you will get some of all the elements
available in that particular column.
That is 160 apply methods something like If you have any function that you defined by yourself like
hey if I define an increment function and pass a value to that like X any parameter and then X fully
equal to x plus 10 or we can say a hundred.
That will be the increment in X and then return x.
That's the function that we have defined here.
Now if you want to apply this function to all the values in B then we use this apply method here.
This fund stand for function.
So you can do something like this X and then pass the column you want to have the function applied on
then don't apply.
And then the function just the function nothing more you will get the output hey a hundred is added
to all the values so you need to pass here.
Is like this one you will get edit or any parameter like column B elements you will again get there.
So just increment and you will have the output.
After that we have another method that is sold underscored values and that's something like sorting
refers to if we have the values like 1 4 2 4 5 6 3 so 2 3 and 9 6.
So sorting that US to arranging them either in descending order or ascending order and generally in
row computer programs we preferred ascending order like 1 to 2 here we have to do then we have three
four four then we have five then we have to six that is this one then we have nine.
So here we have all the values in ascending order.
So this is known as sorting and in programming language.
There are many algorithms for sorting the elements like bubbles or chairs or but they are not a topic
of slaves here.
So I just show you that how you can sort out the element without discussing the methods of sorting because
that will be a very complex topic and you can also study about that one by just googling like go to
Google and just write there sorting
methods and you can find the methods in Python also that you will see that you have different sorting.
So you can check them that's for you now to sort them.
But we have already sorted elements in B like 20 to 20 30 40 50 that we just somehow wearing them like
hair this 150 this one 40 and there we have 20.
And then in last we have between 20 then we have this list now if you want to so the values just you
need to do like X I need to sort of the values in X don't then sort underscored then you pass a function
that is known as sodium and mental distress values and in that you need to just write the column name
like beep the elements will be sorted like 20 20 30 40 50 that's what we have before this one and the
index is changed now and the values of E are also changed but we have sorted according to be you can
do same thing with age also like if I had this one to one this one for this one five and left this one
three and you have this rule until now if you do with a you will have sorted according to it you can
check this out these are not sorted these are sorted but the other values of different other columns
doesn't matter.
So that's all you can.
So the elements in a needed frame now we are done with the sorting also in few basic are left.
Now that is the unique and unique and let me got them from here.
So we didn't get to go up there again and again and remove this one
no
here these are not unique efforts to finding the unique value exist in that particular data frame.
Like if I want to have the unique value in be unique like the 40 50 30 and 20 they are unique values
the 20 twice here refers to 20 is not unique that that is twice so we will consider 20 only once in
unique unique wrappers 2G orderly singles value that are available not the repeated ones repeated ones
are also included but only once not like twenty two times.
So that's what something like X dot then.
Sorry first X and positive column you need to have the unique values in which so X then the columns
like be able to find the unique value in B and then you will do something like just unique and you will
get the unique values like 40 50 30 and 20 here you notice we did not have twenty twice and there's
one more that isn't one of those and unique that will provide you with all the unique value available
there but not the amplitude just in numbers like hey I have four values that are unique and if I also
change this 20 into one to ten there now you will be listing as a network that you will find five here.
So that's how you can find the unique values.
So we are also done with the unique values.
Now just is null and value comes left.
So value counts.
Left is something like If you do X don't
let me perform that one here.
Removing these X stored value underscored comes glances if you get the adder.
Let me have this one
so here.
Had not passed the colon there.
And David go so well you can deliver to how many times the particular value of course like here all
the values are false.
If I again convert that into there and I have to do so now.
And if you perform this one again you will get twenty twice last one.
Now if I also convert this one into 20 and this one into 40 and then you do this one you will get 20
thrice and forty twice.
Here you also need to pass this colon particular column and that's about the value count.
Now the last one is something just to check.
Is there any null value or not is the data frame is null or not.
So that's something like just pass X node and is null then dependencies you will get false 44 for every
value and if you have something like here and B don't none and like here I got the idea for that one.
So that's what I want to show you here.
If you have any known value there.
So at that particular value it will be true otherwise that will be false.
So that's how you can have the null method out so you can check that one some more methods.
I have told you the website group two weeks there to check this and I hope you got all the matters there.
Very easy.
Just you need to focus that where to add to the parameters there to our decoders.
So that's something I believe you are also finding confusing.
So focus on that one and prevent the item.
So thanks for watching.
I was in the next video.