Hey everyone in the last video we have learned that how we can add them by into program.
Now we are going to focus on some methods of pie.
That is something important one and we will begin with some basic methods that are full creating the
numbers.
So if we have a list that is we take a list exposed as an example that will be a one day list and then
the one that is Phi
that will be a list and here we have one not in this one comma two format three fold comma five comma
six seven combined comma might like to know first if you have to convert this one into N and B at A
then you will do something like and B don't every and pass that particular list.
This will convert that list into a number adding inventory.
They will be same like this one.
And here this one if you print x in command here.
These are just nearly similar but this only get the edit and to convert it to be you will just have
these kind of mattresses.
These are the mattresses.
Those who are not met medical students.
These are known as mattresses.
This thing is known as Death Row these horizontal lines this vertical lines are known as the columns.
So these are something you can imagine.
It's known as a variable in which you can store any data in trees.
And every tree have some particular number of columns.
They may be equal and not backward when the they are equal.
And like here we have three rows and three column.
In that case the mattress is known as a square metrics in which we have rows and columns are equal in
matrices we denote the rows with eye and columns with G.
So when I equal to J it will be a square matrix.
They both combined are known as the overall metrics and denoted by I cross J.
Will the daughter of matrix and with the numbers you can create any kind of metrics like if I need to
create metrics as different types like if all the elements in a matrix are zero then that matrix will
be known as a zero metrics and you can easily create a zero matrix with the by my dick Come on empty
dot zeros and then you will pass the order like if you need one the Eddy just pass like this one here
you have all the elements.
If you need to the Eddie then one thing here to focus whenever you are doing something in PI with more
than one line mention you will always need another bracket so another set of princes inside dependencies
you are working in to declare that particular dimension for every dimension when in segment is if I
need to have 2D then I will use this thing inside dependencies so if generally I am using a tuple because
tuple is defined in Pence's inside Defence is now hit enter we will get this but here we have the order
tree grows too.
So we have three rows and two columns you can have any kind.
Like if I write to equals 20 I get this.
Here they are 20 columns and only three rows.
Also you can have square one like this one you can also perform all patients on that like add five hit
enter an area of all the elements with five will be here if you multiply this one you will get a zero
matrix because zero multiplied by any number will be zero test you can perform any operation also minus
one you will get all the elements negative so that's how you can declare a zero error and convert that
one in any kind of number you want to similar to zero.
We have another metric that is known as unity metrics in which all the elements are equal and that one
is something like we can define like and b not ones but in you new metrics there's one more thing the
elements that are one are only diagonal like this one this thing is known as the diagonal that is the
line joining the corners here this one and this one like this one they both are diagonals and in unity
metrics they are all one in identity metrics all the elements are equal.
So this is a difference between identity and unity I get confused in both of these.
So unity is one in which we have the diagonal elements one and you can define that one like and b not
ones here base first one day you will get this one when I pass there will be
I will get this one sorted that one is bonus metrics and to have identity one this one is for one's
metric identity we have and b it I I command is used for that one here you will get this and this is
the identity unity matrix.
This is the identity matrix.
This one is also the identity matrix.
And this one is also known as divine semantics.
These are a little bit confusing.
Sometimes you get confusing these two like not you but I most of the time get confusing these two.
One more thing.
Here we have pass one the character that is only four but we get up to the very next because all the
metrics is that a square matrix will be only in 2D and for that predict Y only one parameter that's
because in square matrix I equal to Z g.
And you cannot have a matrix in which there is a diagonal.
When I is not equal to g like into three rows for Hill.
If we draw to draw a diagonal then this one this one and this one.
Then we divide 41 also.
That's why in only in square matrices we have diagonals and ever be defined any metrics that uses diagonals
will be a square animate metrics and just require one parameter.
So that's about this one.
And in a mattresses.
Now some more concepts like
let me clear this and this one.
So now we have done with the mattresses method that how we can create with them.
Now there are some methods like if you need to create any Eddy at a particular range like and B nought
range that is done.
So here here's how you can create that.
Like if I need a matrix of one dimension up to 10 so you will get a matrix up to 10 and 10 is not included
because in range you know that upper limit is not counted but we have 10 elements that because we have
zero also.
So that's how you can create any kind of array like hundreds.
I get an array of hundred and this one is also one day not to be 2D when we have different set of these
brackets if you want to have to be and you just directly pass something like here.
This one for me.
Like if you pass this one here you will get a Vandy for these like from three to 10 in which 10 is not
included.
And always the lower limit is included upper limit is not included.
And if you want to have to be added with this.
Come on like I have 50 elements then how to create that we use a different method in this one that is
first and we would arrange a list of 50 element or we can say that at or 50 elements then don't we use
this shape method to define the order of debt metrics like if I need a matrix of in which 50 elements
and five rows and and columns and hit enter.
You will get a 2D dates here you can see we have these brackets would have little and five rows and
columns.
So that's how you can create a 2D matrix with this one.
And there are a number of ways you can create with anything.
I'm just focusing on the basics one so he will understand better now.
This is a matter of creating this one matrices done reshaping and arranging them.
Now we have something known as Linn space that is also known as the linear space let something like
if I have a hundred elements or not hundred if I have just organism 10 elements and I want a matrix
or because of that edit in which we have a hundred elements each are linearly spaced means that difference
between every two is seen then we use the land space method.
This one is also the important one while performing the visualizations here we just use Linn and then
space mean linear and then space then the brackets if you pass something like in this bracket faith
you will get added.
Because this requires more than one parameters and if you do something like this one zero comma one
hit enter you will get a number of elements here each of which are linearly spaced if you can notice
here zero point two then zero point four This one is for 0 8 1 6 this is it double and if you want some
specific number of items like in 10 I just need five elements.
Then you pass the third paragraph so that defines the how many numbers do I need.
Hit enter.
You will get five elements and each are linear Lisbeth.
Like 0 2.5 then 5.
All three are different by 2.5.
Then we have seven point five and 10 more common example if I use 2 here I will get to 0 10 because
the end minus 0 0 minus 10 equal if I use something like hundred here and 5 here.
Hit enter 0 25 50 75 100.
So here I have only five elements each of which are linearly spaced with 25.
The difference is 25.
That's all you get to linearly.
That is linearly spaced.
After that few more methods like if you have this city you want to find the maximum of this one.
So first you need to create that one into one number that is X and B don't agree then the X you enter.
Now here let me do both this one
now if you find one to find the maximum of this one you just used to need need to use this one extort
maximum and Pence you get the maximum value that is five if you need the minimum then X dot minimum
hit enter.
Also we have different methods for maximum and minimum about which you will learn later if you need
to find the index of these four then you can also find the index of these one by using the argument
after that some random values like if you want to have some random value.
This is the last basic one.
So if you got bored individual then please pay attention.
This is going to be love last basic.
So if you want to have some random value then we use and be not random that is a and b name by not random
and in random.
We have few methods out of which one is like if I have this one you will get five random values that
are between zero and fun.
So this trend is used to have random values between 0 and 1.
If you need negative values also then you lose.
And here that stands for negative also.
Then you will have some negative values also in this trend of values.
They are differently spaced and randomly choose between zero and fun.
And here also with minus one after that if you want to have something like random value from any specific
type like if you need integer value then you use end end then pass princes in which you want to have
dead end of value.
That is a forty one is selected.
Again if you hit enter in this one different value selecting again to enter 66 again today.
So that's how they vary.
Again and again.
And if you do something like this man also you will have the same dessert so that so you can have the
random values in integer form in 0 1 form and negative also.
So we are nearly done with all the basics in this one and one more I forget him.
That is the index I am talking but I did not tell you there.
That is how to find the index of this maximum value so you can find the index of that particular value
life just like using X dot and then use IRG the stencil argument then the function whose value you want
to need.
Here you have 4.
So if you count the index 0 1 2 3 and 4 this one is on for similar for minimum value.
We have volume 0 so that's finished now.
We have done all the basic methods that are in num by and that we are going to need innovative visualizations
and that are the creating of mattresses creating matrices of special type like linearly spaced and within
a range that is the range we have used range function a range.
I think you got that one also.
And then we have maximum minimum values there indexes and then the last one is the random values.
So thanks for watching.
With this one and we will continue in the next video.