Hello from Molly would begin with the next module, which is data handling with Python in this module,
we will discuss data handling with Python and the discussion will be immediately around two packages,
which is number by and Fondas.
After learning about numbers Fondas, we would move towards data visualization.
But the main concept here is not by and Fondas.
Mambi is the original package in Python, which was designed to work with multi-dimensional eddies.
So this eventually enables us to work with the data files.
But Fondas is a high level package which is written on top of mumfie, which makes the syntax much more
easier so we can focus on the logic of data handling process rather than getting behind how the syntax
is written in numbers.
So it is good to learn number, but while working with data handling, we would be majorly using Fondas
library.
So it is good to know no by initially so that you know what is going behind and how data looks behind.
So we will begin with no initially, so let's go ahead with it, let's begin with number.
So far, no, this is the documentation which is available it is available right now by dot org.
So it has all the details about the pilot.
It has the basics, how it is are created, how indexing and slicing is done, and how we can handle
different multidimensional eddies and how we can change them, reshape them, how we can create them.
All of the information has been provided here, but we will not be going very in-depth in this.
We will be directly digging in into the main concept and the main functions which are provided by the
library.
So to begin with, the number three stands for numerical fighting.
So it is a liability which is consisting of multi-dimensional aerial objects.
So we will be working with multidimensional areas here and we will be using Mumfie and the mathematical
and logical operations on it is so we would be learning.
So to begin with, the first thing which we will be doing is we will be importing the number like.
So while we begin by labeling both, so the first thing is to write in both.
So we will write import import is to get a particular library in our current working workspace, so
the library name is No.
And we want to provide an alias name.
So usually what happens is that we do import numbers.
And then each time I want to run a specific function, I will have to write something like Mumfie,
not random.
Don't random.
And then I'll have to run this.
So this will give me some random number, but every time I'm writing this entire number, I may not
be much feasible and we want something we can short.
So what we do is we create an alias name and we see nubby as a..
Which is kind of a standard right now.
So we will instead of number, we will write in an.
Once we run the first line and this one, so it will generate the function, it will run the function
using this particular areas.
Now let us learn about different functions which are available with no.
So the very first function which is available is to generate random numbers so we can generate random
numbers using them by using ENPI, not random, random, random is the function name, which gives us
the random numbers.
So each time I run this particular piece of code, it will give me a new random number.
Now let's see.
I do want to generate random number, but I want to generate the random number again.
So I have generated one random number and I've used it for some calculation and I want to just perform
the entire thing.
I want to do this thing again in front of my project team or anyone in the team.
So what I can do, I want to fix this randomness.
So what I can do is I can create a.
So how do we create the scene we see in the random.
Doc.
Sede.
And inside that, we can give any number, any number.
It can be it can be 800 any number you can give any number in the seat and this seat will decide what
number would be generated.
And this statement has to be just before the random number generation.
Otherwise the random generation would not work.
So if I write it this way, it will generate this random number.
And if I run this again and again every time we will run the same, give me the same number.
So if I just change the number to thirty five, it will give another number.
But this random number will be fixed on the basis of the number which I'm giving in the seat.
In case I give any of those statements.
Brand gap.
So what happens is it still runs this, so each random number will be based on this scene, so it'll
just do the same thing for you.
OK, now if I generate on the random number after this.
And let me bring up this one.
So you can see you can fix the random numbers like this, the next thing which we have is.
We can have different mathematical functions, so let us see, we have this random number generation
now, it has more to work.
So in case I want to generate a specific number of values, then I can give those here.
So initially, when I did not give anything by default, the argument was one to one number was generated.
I can give four.
So four numbers would be generated if I give say forty one or let's say.
Twelve, twelve numbers would be generated and one thing to note here is that all of these random numbers
are ranging from zero to one.
All these numbers are between zero and one.
Now, next thing what we can do is if we want to upend these random numbers, let's say so let us do
one thing, let me create a number X and put these numbers in front of it and.
Let me explain you, I'm looking to create another.
Everybody and this area I'm doing and be dolled up and so what up end does here is it will upend the
new numbers generated in front of the X, so I'll give.
X and I'll give what I want to append in front of this, so I want to open more numbers, see, I want
to open just five new numbers.
And I'll print Y for you.
So here you can see the numbers from zero two.
This one remained the same while after this.
The five new numbers have been generated and upended in front of this.
So this is what a bank does.
It is a little different from the up end, which we were using in the final list.
So when we used a pen in case of list, it used to add the new numbers generated or the whatever values
we were.
Depending on a single index back here, it would not happen that they will simply walk like extend how
we used to work.
It will just add new indexes and I've each value in the new indexes.
So this append is a different from the list in the list up.
And so just don't confuse between them.
The next thing which we have is run numbers, and so we have learned how to generate one random number.
We have learned how to generate random of a list of random numbers in any random numbers.
So here we have generated random numbers here.
We have upended the random numbers in front of these.
Now, let us say we want to generate only a specific type of number.
So let's say I want to generate, say, on the zeros.
So what I can do is I can simply write and be Dawid zeros and it will generate the number of zeros which
you want.
So if you want 10 zeros, it will just generate zeros for you.
So it generated 10 zeroes.
Now, if you see these are floating point numbers, these zeros are floating point in nature.
So if we want to change the type of this, what we can do is we can add another argument in front of
that argument for the type.
Is he could do anything, Dot.
And so this way you will get the individual numbers, similarly, what we can do is we can have.
Instead of Zardoz, let's see, we want to have one's.
So we can generate plans like this, another thing, what we can do is this what we have generated is
the one being it is only a one direction and 80.
So in case you want to generate multidimensional eddies, we can simply give the same thing.
And instead of giving this, we will give the size of the adding a couple of them.
So this is my capital and this could be saved and come up five.
So this will give me then cross 580 in case I want to have something is.
See ones all.
Sorry.
See, do you think I'm a fool so I get to cross three rows for this and it would be generated?
Now, another thing, what we can do is in case we want to generate something with the empty values
or garbage values that is also available.
So in that case, we can simply write empty.
So it will just generate empty values.
Apart from that, what we can do is.
We can also generate some numbers in a sequential form, so what we can do is we can maybe get rid of
this for now and we can generate numbers using a range.
So any change is somewhat similar to range, which we used in.
So what did Range give us?
Range used to give us the number of values from zero to whatever number we're writing here.
So in case I'm giving then so it will give something like this to me.
And in case, let us say, let's change this a little bit, let's try a few variants of this.
So if we want to get values from C instead of I don't want to begin from zero, I want to begin from
five, then I can give five, comma 10.
So in that case, I get values from five to ten minus one.
The next thing what I can try is I can keep.
See, I want you to have numbers from five to 50, and I want to skip five numbers and Beddawi so I
can do it this way.
Now, another thing which I have here is I can reshape this.
What I am generating using it is a one deti so I can not only specify the other dimensions here of the
any here.
So what I can do is I can simply use a dot reshape.
And this door to the sheep will be able to change the dimensions of it.
Now, if you see we have three.
Six, nine values, so that means I can have something like three comma three here.
So I can create a TV commentary out of this, but in case you want to create something which is.
Not exactly the number of values which we have, you know, to say we need to treat it gives in it.
It is saving the Creative Commons.
It will again give error because the number of ideas generated using this inch function does not suffice
the volumes required for this particular issue.
So this is one thing that you need to take care of by using the eatings function on other functions,
which we have are.
Oh, let's see, we have what else we can do out of this, so we have this we have with Ricci, we can
also do one more thing.
We can use a little space now trying to understand the difference between eating and living space here.
So let me write it down for you.
So when we have eating's.
OK, and when we have mindspace.
So in case of orange, we provide the starting point.
The ending point.
And we provide the steps, right, so because we provide these values.
So it automatically finds out the number of values to be.
Generated line in case of mindspace, what we do is we provide the starting point and we provide the
ending point.
So these are the common things which we are providing.
Apart from that, what we provide is we provide the number of lives you want.
OK, so what happens is in this case, it finds out.
OK, so this is the difference between eating in space that in case of eating, we provide the stopping
point, the ending point and the step between one.
And in case of space, we provide the starting point, ending point and the number of values which we
want now, because in case of eating, we have the number of steps.
So it has to find, though, the number of values it need to generate automatically.
So it will automatically find out how many values we need to generate based on the steps which we are
provided by in case of mindspace, because we have provided the number of values which you want.
So now it will find out the steps which would be required.
So it's like the only thing in it.
And we provide the steps and in case of space, we provide the number of values which you want to generate.
OK, now let's try to generate a few numbers out of this so what we can do is we can simply say in the
dot space and we can provide the starting point and ending point.
Let us say I want to start from one and I want to go to say seven.
And the step which I want to know the number of values which I want to have is.
Let us say.
Let us say we want to have five values in between this, which is kind of odd, but let's try this.
So it.
Generates values like one two point five four five point five seven.
Now one more thing to notice here is that in case of an age when we provide the starting point and the
ending point, this ending point is not included.
So the numbers which would be generated, which will not have this ending point.
Right.
But in case of mindspace, the ending point is inclusive.
So one more point, which we can add here is.
So this is.
No.
Ending point.
Is not inclusive.
And in this one.
Ending point is inclusive.
Right now, another thing which we have here is in case you don't want to include this ending point
here, in case we don't want the seven to be counted, we wanted to work somewhat like eating.
So we can provide and point.
I voted for.
So now the number generated will not have the.
And going for it.
OK, so let me kind of copy this and.
The second I show you the difference, you OK?
Now another thing, what we have in case of mindspace is we can also return the step function.
So what I can do is I can simply write, read, step.
And I will make it as true, so it will reduce the number of steps, so the step value is of one point
to.
Which is right, point 2.0, minus one is one, point two, which is the stamp value, which it has
considered.
So this is what we can do using of these functions on a function which we have is we can apply a different
mathematical operations also.
So let us see, we have some numbers they've got to let us see nine.
So what I can do is.
For example, tonight I can find out.
Ruth.
Is equal to.
And B is you, Artie, which stands for a square root and I got an X and say this and I'll just print
it for you.
So this is three, right?
Similarly, if you want to find out the power, we can simply say power is equal to.
And they don't bother.
And then we can give some numbers, say, let's say again, let us give Exxon your let us give three
and we want to raise it to the.
Flavor of sea.
Three again, so or let us for two for convenience and in info, so it gives us nine.
So it means that Victor is raising three to the power and it simply finding on the square root of nine
here.
So this is something which we can do.
Apart from these.
There are a few things also which we can do like we can.
Three, eight it is, and we can slice them and we can read them, so let us do one thing, let us generate
a few more is.
So let us create one for now.
So.
Let this creep and Eddie.
So for creating an ad agency is equal to and B dot.
Every answer, you give it enough sound foundations and then we start the rectangular.
Now, when we give this rectangular braces, this means that we are giving the dimensions to it.
OK, this is like the fourth dimension.
So in the fourth dimension, I can add any number of values so I can add one, one, two, three, four,
anything I can.
So this is my area which has been created.
I'll print it for you.
So this is my area which has been generated.
Now, in case I want to find out of the size and the dimensions of the area, what I can do is I can
send a dot and.
So it gives me the dimensions, so this means that this particular area is having the dimension one.
So this is I one theory.
OK, I'm the find out the shape also so I can see and shape.
So this is for something.
So this is basically up for values inside.
Now, another thing, what we can do is.
We can generate multiple dimensions.
It is so what we can do is let us copy this again.
And for the Tiel.
OK, and let's do one thing, let's bring.
He and his friend in the also.
And we will bring this shape also.
OK, so let us add more dimensions to it, so let us do one thing I just created to do it.
So what are two plus two, Eddie?
What we will have is we will have two dimensions.
So this will be like fourth dimension.
And inside this, I have another dimension.
OK, now we will have a that is generated this way.
OK, so it will be like this.
So something like this would be the.
And it will be comma separated and it will have.
Another.
Something like this.
Now, does this look like an idiot to you?
Just try to consider this, we will have some number one or two here and we have another number one
for Montoyo.
Now, let us run this.
So here I have this eerie.
Two rows and two columns, so what did I do here is initially I had only one rectangular braces, OK,
now in this case I have to take mangler braces, which means that now I will have two dimensions.
OK, when I start with the fourth dimension, this fourth dimension has two rows in it which are again
depicted by one rectangular braces.
So each role is depicted by one rectangular Brisas and it is separated by comma, and each column inside
the room is again separated by OK.
Now, what we can do is now let us try a few more variants.
Now, what else we can do is instead of having a truly very sorry.
Let us generate a 3-D video.
Now, let me do one thing, let me add another.
They mentioned it.
So this is two plus three right now.
I want to have one more damage.
OK, so when I want to add one more dimension, this means that I will want to have.
One more of this thing.
So what I'll do is I'll read up on my here.
And after coma, I will put the same thing again.
So.
Now we will have.
We will have three brackets for three dimensions.
Now, consider this, this is the fourth dimension, the fourth dimension has one in depth, and after
that, when we go into this first break inside this, I have two entities.
One.
And these are doing so now, the dimension becomes one.
Do I say this to what I have is I have again, so let me run this.
So we have.
Two, which is the rules, and inside this, I have only three columns, so this becomes three.
So this is do comma two or three, which means that in the first record I have to matrices.
I'm these two matrices internally have three matrix, so I have two matrices of two, three, eight.
So this is what this means.
So you can try a few more variants of this entire thing.
Now, another thing, what we can create is this is one way of creating it is now another way of creating
it.
It would be if you want to create the identity, which is again used very, Heidi, so we can see why
is equal to and B dot identity.
And we can simply give the dimension of it now because the identity is of having the same dimensions
on the in both roles.
And so we can just give one value leg instead of giving five cross five, we can simply give five.
OK, so this is what it would generate.
So this is a five plus five identity matrix.
Now, in case we want to multiply this by any number we can do that we can give buy into do so, it
will multiply all the values by two.
In case we want to generate in theory, using randoms, you can do something like.
And the don't.
Vandam.
Not random.
So we saw that to begin with, one number like this weekend weekend generate through DNA using this
just has to be given in a double form.
Just on.
Now, this has to be given up before now I can.
Increase the dimensions and can do anything like this, so this is what we can do, apart from that,
we have learned about the ship also.
Now let us see if you want to do some kind of slicing.
So let me create another eddy.
So let see in the dark.
And Ange and let me just read what Cathy.
And in this 30, I can have thought the shape.
And I can give.
For.
Or five Gomaa.
Three, former two.
Or let us give.
Three, four, five.
So we have invaded this area.
Now, what we can do is if we want to achieve some particular value from this, so what we can do is.
So let us name this as X.
Let me print X.
Now, from this experience, again, appli slicing on top of this, so how do we apply slicing weekend
some eggs and let us this so let us try to get you out of this.
So when we get to we get the second matrix from this.
You notice the shape is three to five, so from the first dimension, it picks out the second and makes
eight.
So we get to hear if we want to get, let's say something like.
Zero to two.
Being get like this, so this will give zero, one and two is always kept in case of slicing.
If you want to get all of these, then we can do it this way so it will get all the values out of this.
Now, I the thing what we can do is let us see.
We want to get these two values so we can see one, two on.
And from the second index, so let us first get this much.
This is what we got now from the second index, let us see, I want to get.
These alternate values, I want to get 11, 16, 14, 18, 21, 26, 23, 28.
So what we are trying to get here is from each role, I want to retrieve the.
Second.
And the fourth column, so the index would be one.
Now, let us further try to modify this, so let us see what we can do.
So if we try to get values from zero to the end, it gives us the same response.
Now, we've won the first value to be in heaven.
So instead of zero with one.
Now, if you see this has figured out the rules.
Which means that it will pointed out that Rossmo.
So if you consider what it is doing is let's get all the bad news so it goes to the first.
And some people, as I mention it, some of the volumes now, because we wanted these two brackets to
be considered, these two is the first index and the second index to be considered, that is they need
to get from one through to the end.
Now, this bracket has already been taken below.
So this is what this supposed to.
So now what we do is we get to the second.
Now, what the second bracket gives us is the second bracket, again, has the rules, which means that
this particular golden rule for the rules now legacy, we don't want all the rules, but we want only
the second rule to come up.
So what we can do is we can simply give.
Do you?
So it's not giving any value.
So it gives the host the second index.
Right now, we want to obtain 16 from this and 18 from this.
So what we will do now, we are going for the volume level.
So this is the next level.
So we call my here.
So now.
We won the Boston Nicks event, and then we wanted in the end, but we want a step function all now,
let's all get the step function.
Let's go this way.
Let's run this.
So we get from 16 to 19 now, but we don't want 16 to 19.
We want only 16 and 18.
So now we can put a step function in front of this by adding Apollon again.
So we put step function school.
So now it will give us 16, 18, 26 and 28.
So similarly, you can try different combinations and try and.
Now, let us try to do some more changes.
Now, in case we want to get that out on this particular condition.
OK, so let us try to do one thing.
Let's find out what is.
It's.
More so.
OK, we are making X Montu, and we are checking with empathies equivalent of zero, so this redounds
these values.
So we are getting to drill to drill, too.
So if you see all of these values, I was able to.
So we are simply getting the even values out.
So I'm just figuring out so right now it is just a condition.
Now I want to apply this condition on my Indian.
So what I do, I simply say X and inside the braces, I will put this condition.
So I will send people this condition inside this braces.
And when I run this, I will get all the.
Even values now on top of this, I can apply the ship in case I want that.
So that is how we will.
Now, the next thing what we can do is we can again apply different combinations.
Now, let us try to put in those photos, so let's try something else or let's say it's because then
five.
So we get all the values that I like put also give values greater than 15, I can apply something like.
Although values could be like any kind of rule, that would be a place now for the we can try some more
things.
Like, we can add the values of a president and the entire thing, so before doing that, let alone
the concept of access here.
So let us say we want to find out standard deviation.
Now we've learned about our we've learned about squid, so let's learn about standard deviation because
it is again, less news so we can do something like.
We can find out the standard deviation of X, so in the.
It gives the standard deviation of things now in case we want to find out the standard deviation across
a particular axis so we can do something like.
Copy this entire thing.
And we can simply say.
Axis.
Equal to zero.
Which comes out of these values and let's see ENPI.
And we say axis equals one.
So it comes out to two point five.
So what happens here is that for these values, the standard deviation is calculated on the basis of
the axis values.
For these values, we can find out the standard deviation.
So the difference between these values, the maximum difference between these values is point five from
the mean.
Right now, if we compare with respect to the now this is on with respect to axis of Z.
OK, so for Access Zettl, it is shaking at every level.
So for every rule, it is checking the standard deviation.
So standard deviation of this rule internally is.
Standard deviation of these values is a standard deviation of these values.
So for each.
Follow the standard deviation is Jay, I'm going to go again, the standard deviation has been.
Now, when we mean access equals zero, this means that we are checking on the rules.
So we are working with E to.
We are talking about combating Boodles.
And when we are talking about X is equal to one, that means that we are comparing in the volumes.
So we are comparing apples to apples.
That is why it is coming to you.
And here we are comparing across the rows.
So it is coming us to eat something.
The next thing what we can do is we can find out the sample and support these values.
So in case you want to find those dimes, we can send in some.
I know you just give the name of the Matrix.
So this is the sum, if you want to find out the same across a particular axis, then we can do the
same thing just for axis equal to zero.
If you give the sum.
If you put the axis equal to.
When you give a body, Google X is equal to one, so these are a few things which we can do.
Apart from that, there are a few more things like religion reading, although we will be walking with
already the data, but in case we want to plead for so forth that we can use random choices again,
the ever again.
So what we can do here is we can do something like in the.
Not random.
Don.
Joyce.
And we can simply give the states or we want to get the values from X and I want to be selective in
values randomly, so it gives me the values.
Let's do one thing, another thing is like this has to be one theory so we can do something like we
can create Excel or we can simply give an angel to you.
So let's be the nearest being.
The one here is equal to the dot range.
And we give, say, happy values here, so I will randomly pick out values from these values.
Now, let us say, instead of Ben, I'm giving just Ben here.
So if I give them, it takes out then random values and you can see that the values are being repeated.
You.
Now, another thing, what we could do is.
We can give five values also and take our values from five.
Now one thing we can do is we can use replace here.
Now, what replaces allows is that it will make sure that if we can replace values or not.
So if we make the place equal to zero or false.
So what happens is if they throw in it, it was throwing at error because we are giving only five numbers,
then we are saying get the numbers out of these five numbers and go into the numbers.
So that is something that we can all do so that we walk only if I give a boost in numbers to.
So now it was in their numbers randomly, and it will not it will not repeat them until now in case
I give lesson number and I want to make it basically, then this will not work.
So if I make it to.
By this is value, so it works like this, so you can play around with these values.
Now, another thing, what we can do is.
We can feed those values, which from which we want to see, I want to select from random values, so.
So I'm making a choice here out of a list of, say, zero and one.
And I want to select again such occurrences.
So it gives me one zero and one so instead of zero and one, I can give you 10 points or also.
Or I can give any values the.
X and Y, so I can do that also.
Now, one thing to make sure is that it will always try to give the probability it will be almost 50
percent higher.
So the probability of getting X and probability of getting Y would be equivalent.
So no matter then how many valleys you get, if you get a values, also, the probability would remain
the same.
Now, what we can do is we can take this also.
So let me get these values in.
Why let us see, so I've got these values and why now I can check if the number of unique values so
I see unique.
And I will check the values envie, and I see that on.
Count is equal to two, so now it will just reduce the count.
So when I ran this.
So it will give the balance of this so because we have a thousand values in lives or in most people's
independence's, let's say if I give them thousand values.
And this, again, it is even more and more the number of values we have, the more that it would get
to that 50 nation.
Now, another thing, what we can do is we can also give a particular probability to these.
So I need ninety thousand views, and apart from that, I will give the probability and I will see I
want the probability that we will do the same.
Point seven.
Whinfrey.
And let us keep as many thousand.
So let's run this on the let's run this also.
So now you can see we've got the similar kind of facial, so these are around seven thousand twenty
thousand.
So the probability has been taken from this, what we have provided here in the last one so we can do
these kind of things.
Another thing what we can do is we can generate some random numbers, like let's say we want to generate
some numbers in the door, random, not random and the individual.
But you want to generate we want to receive the lower value to be.
The theme and the higher value.
Do we see on hundred?
And we want to give some results also, we see size equal to.
By phone lately, it's generally this policy matrix with lower value being 15 and higher value being.
And if you write if you visualize this, then you will find out that these values are actually spread
out equally.
So there is this would be kind of an anomaly form.
So the data would not be present in such a way that some values, no values would be higher.
Higher values would be lesser in numbers.
Nothing like that would happen.
It would be a good spec of data.
It will be spread ecovillage.
So these are some of the functions which we can apply on UNCOMFY.
So next, what we would learn is we would go about five dollars and we would work on a data set if possible.
So let's go ahead with that in the next edition.