Hey everyone.
So in this video we are going to learn and indexing and slicing in to the edit.
So for that that just create that DNA by using a..
At Ange
and at least don't let me have all 50 elements this time.
And then we use data in shape to define the order that is five.
Gross.
Or just use 25 elements.
There's also enough for demonstration.
So here we have this one and index.
Here we have now to excessively element in this one.
We have two different methods that is first one is something like the list that is positive Austell
event 2.
And then he had three that first one is denoting the row that's I.
And this one is G.
So if you want to access this do it then how you can access this one is first in DRO 0 1 and 2.
So the row will be 2 and the column will be 0 1 and 2.
There is also a shift center you get detoured if you want to access 22 then it will be fourth row.
And second element.
So the second column.
So that's what we can use the indexing to the array.
You can also use something like X and dispenses this one is in Python 3 Lightfoot for us to do we have
the added that may not be happened here.
But so this one is this just shift into so there is no different is that the package there.
I got a little confused in that.
So sorry for that.
Here we have this one.
You can do the same.
The D like food comma to shift into you go to 22 that's about the indexing and now what about the slicing.
What if you need to slice like here These 2 3 4 and 7 8 9.
So how you can slice it.
So in this just like that one they used something like one and then this thing up to date that we used
the same thing but for 2D and for that we use that word twice.
Just like that.
So if we need to have this spot.
So first we define that which tools we need.
So we need the draw from that is zero for this one and this one is 1.
So we need 0 to 2 because the upper limit is not included then V you lead the columns that is this column
this column this.
So this is second third and fourth.
So we use after 2 all the columns.
So here he can shift into here we get 2 3 4 and 7 8 9.
You can do same thing with any element here.
Like if I need to have this one this one and this the square matrix of six to 18 we will do something
like.
Let me clear this one here.
This will also no to have this one the row I need is that is first second and third.
So I will go for first two four equals upper limit is excluded.
Then I will use the column that is again same first two fourth shift until you get these elements.
That is six seven eight eleven twelve thirteen and 16 17 18.
Next how you can slice any list in number by my using this thing.
One more thing that I want to teach you here is something like that is known as conditional selection.
That is if we have let we have another one here.
That is something like and B don't arrange and from 1 to 1.
Here we have VI this one if you want to have something like all the values greater than just like here
we have well so greater than 20 then you do this thing you will get a list of billions in which all
the values lower than that one will be false and higher than that one will be true.
And if you need the values there because this one true false issuing the indexes we just use again a
value here and this one in these brackets then you will get all the values.
So this thing is known as the conditional selection.
You can have any kind of this one here.
You can also have like less than divisible just by using the remainder.
Like if I show you something like the values that have like Y then I use the reminder operator like
the US in this data and is equal to zero.
I think that may invoke and this one needs an equal to be done maybe.
So I don't know what is required for the reminder and if we work for less then like four we have one
two three four reminder we need something like reminder of that we do is not equal to zero.
Maybe I have divided that one with zero that's why it's not working.
So here we have this one there I have done zero because zero division is not possible.
So this is about this one here.
Condition selection this one is not used much in any case I have not even used that thing anywhere till
now just the operators and operation just have to solve any problem but still there is something you
need to know.
That's why I had to do that.
So thanks for watching and we will continue in the next video.