Hello, guys, and welcome back to another class of our course, I want the complete introduction to
the science with Python.
So in this class, we are going to learn some more mathematical operations that can be used with numbers
on Python.
So basically, the operations that we are going to talk about today would be all the basic operations,
such as additional multiplying by adding and subtracting all this with arrays.
So it's going to be basic matrix operations that I'll show you how to do.
So we talked about it a bit earlier.
We're just going to have a refresher.
We're going to talk about putting everything into one single column.
We've got to talk about some of axes.
So basically how to make a sum of axes and the square root and the standard deviation function.
So let's start.
So before we start what we need, we need a Arry.
So basically what we'll do, we'll create a two dimensional area and we'll work with it for the purpose
of the whole course.
So pretty simple naming are one.
And this one dimensional area would be like always an area with even numbers.
So here we go.
So we'll have two, four, six.
And the second one would be one three five.
So, as you can see, pretty simple.
Next thing that we will do, we'll have our second.
So in this case.
He was a.
Well, we are seeing right here, which will be number two, and basically you guys can change numbers
or you can keep the numbers as they are basically to change the numbers just for the purpose of the
example.
You don't need to have the same numbers as me just to show you that we can make some basic operations
on average.
All right.
So the first operation that we are going to talk about in this well, and this, of course, will be
the addition to basically how do we make basic operations?
So metalworks operations on the air is pretty simple.
Simply write down print.
And from this point, what you want to do is simply select your battles.
In this case, one plus two, and you can run the up and you will have the answer right here.
So basically what it will do, it will simply do a basic mathematical well, a basic matrix operation.
So in this case, it's an addition.
So we can do the same thing for substraction.
I can do the same thing for multiplication, so if you want to multiply errors and finally for all divisions,
so it's going to work pretty well.
So you can see it gives us the right answers each and every time.
So this is for Matrix operations.
As you can see, it's pretty simple to understand.
All right.
Next thing let's say you guys want to print, so you want to put everything on the same rules.
So let's say you guys have in this case, we just kind of keep one one every so so you have this area
that is two dimensional and you want to put everything on just one column.
So it's pretty simple.
How do we do this?
So if we print the blueprint or one, then you guys can see right here that it's on two rows.
So basically it's two rows.
And if you want to put it on just one column, how exactly will do it do it?
It's pretty simple.
So I'll print both of them.
So we'll have we'll have the original one and the other one.
So it's going to be pretty simple.
Simply right now we are one in this case, the name of your variable that really will
open and close parenthesis.
And here you go.
So if you bring if you print it, as you can see here, you will have everything.
So all your numbers on the same columns with just one column for all the numbers.
All right.
Next thing that we are going to talk about is the sum of axes and basically went on saying some of it
says you guys can make a sum of all the columns as well as all the rules on your wealth, on your in
this case.
So how exactly this works, it's pretty simple.
So once again, we have our eye right here.
And to be able to make a sum of Xes, it's going to be a basic sum operation.
So simply write down when your friend is here, write down the name of your function of your variable.
So in this case, it's going to be the one that.
So usually if you do this, if you just run a sum function, it's going to calculate the sum of your
title of this right here.
But in in the case, it's one, two, three, the sum of exit of the of an axis of the axis.
The way that we do this, it's pretty simple.
So we just open up that parenthesis.
And from this point, we just write down axis.
And in this case, the access could be equal to one or zero if, for example, right down zero, as
you can see, it will calculate the sum of all the columns.
And if we write down, one will do it will calculate the sum of all the in this case.
So if we print both of them.
So if I print, for example, my.
Well, my variable in this one, and I run it so as you can see, first thing is going to be this.
So basically if I select access equals to one, it will calculate the sum of all the numbers right here
and all the numbers right here.
So 12 will be the sum of six plus four plus two.
So it's going to be 12 and nine will be the sum of five plus three plus one.
If instead I write down equal to one to zero sorry, and I run the app, it's going to be the reverse.
So what's going to happen?
Three will simply be the sum of two plus one.
Seven will be the sum of four plus three and 11 will be the sum of six plus five.
Those can see it's pretty simple to understand.
All right.
So right now that you guys get the sum up axis, the next two things that we are going to talk about
will be the square root as well as the standard deviation.
So basically how the square root function works, it's pretty much the same as it works for if you make
it on Pythonic without using Iris.
So it's going to be the security function, but it's going to be written with non-pay, with the NUM
by a feature.
So simply write down print and keep that square so security and then you enter the name of your variable.
So in this case, the one and you can run.
So what it will do, it will calculate the square root of all the numbers.
So basically the square root of two, the square root of four of six, then the square root of one right
here in the square root of three and the square root of five.
Same thing for the standard deviation.
So basically what it will do, it will calculate the standard deviation of all the numbers and give
you just one answer.
So basically this is going to be tested.
So if you run the app, it's going to be a bit different.
It's going to give you just one number.
So basically the standard deviation, all the numbers right here.
So we talked a little bit about standard deviation in the statistical part.
So if you guys are interested to know exactly what is the standard deviation, you can just make a research
on it.
But to run a standard deviation operation, it's pretty simple, simply.
Right.
And it will work.
Same thing for the square root function could be really useful, for example, for the standard deviation.
Could be really, really useful.
If, for example, you want to compare a number to, for example, demeanor, the average, or if,
for example, you want to calculate, I don't know, let's say the volatility of something, if something
is really volatile or not volatile at all, if there is a big difference between the numbers between
them or no.
So this is for this part of the course.
So right now, you guys know a few operations of numbers.
There is a lot more other operations that exists, but those ones form the basis.
So let's address those guys and see in our next.