So let's go to a deal and test out the packages we just installed.
I'm going to come over here and search I.T. early and then it's over here.
Right.
I'll bring this here.
So there are packages and modules modules are contained within packages.
You can think of a package as a folder and then a module as a file.
So importing packages are very simple you just use the import keyword with a package name.
Let's see what I mean.
We're not talking much so let's say we want to import the NUM Pi the NUM pay package.
We can simply say import num pi
like this.
So within this package the various functions the various modules and functions that we can use.
So for instance let's say we want to find a range.
We have we have low an upper limit and want to get a range of numbers within this this limit we can
use the A range function and let's see what I mean.
And the purpose of this particular lesson is not to teach you how to use this.
We'll get into that later.
This is just to test our packages so I can come over here and say X equals a range a wrench a wrench
here is within pi life of imported an umpire.
But if I see X course in range comma 10 and this is how the range function is used an error would be
thrown because it cannot see a range really.
What I have to say is X because none pi dot a range.
So let's say I come here and say X equals num Pi which is the package named dot arranged and then now
I pass one and 10.
Now it's done it perfectly.
Now if I say X to print x we can see X is an array from 1 through 9.
And this is perfect.
So all the time if I want to use in a function within num Pi I have to start with an umpire or to this.
So because of this we can rename the umpire to something shorter we can give it a new name and to do
this we can say import num pi
us and P.
So now whenever I want to Type Num Pi I can type and P.
So now I can see why you cause a..
Dot a range and I can pass the same one in turn here.
Hit enter and then hit y here and I can see why is just like X better still if I don't always want to
add the package name and a dot I can import this a range directly and then where do they see I can see
it from num pi.
Now it's a similar move and speak into an actual human being.
Python is so simple it's so plain in its language that it's easy to learn it so I can see it from num
pi import a range sorry about that.
I have a typo here.
It should be a I the A.
So I can see it from num pi import a range like this.
So now I wouldn't need to put end dot a range or an unpaid or air range.
I can simply call a range and I can do that by saying z equals a range 1 10 and it's perfect I can print
c here like this and I can C C is just like Y an X right.
So this is how to import various modules within a package or import just a package alone exit error.
So now let's move on let's test out.
So this here wasn't to teach you how to program num PI was just to test in pi.
And I use this as an opportunity to show you various ways in which we can do the import.
Now let's look at my plot lib so much put lib is an entire package.
But we need a particular module in my plot lib known as pie plot and because of that we're going to
use a statement similar to this.
We can save from mut plot lib import pie plot as P L T.
So we want to shorten the name as POTUS like this and then we hit enter and once that is done.
Now let's see what indeed the PI plot works so we can do that by saying P L T dot plot and we can plot
z over here.
I just say plot and parse see here once the ice is done I can see BLT dots show and this will show the
graph and this will verify that indeed our plot lib installation was successful.
So hit this.
And this indeed is the graph.
This.
Right.
So now let's test the last one we also installed a side pi.
So now let's see CI pi.
We've tested num pi.
We've tested my plot lib.
Let's test side pi.
Now we want to test with a module from side pi known as signal.
And this is used for signal processing applications so we can see from side pi import signal.
And over here once the import is then we can just use a simple function known as the window.
We we can just test out a window or we'll learn about how to design our own windows such as how many
window honey window bar let window etc. Later we just try.
Simple example here to verify that indeed our side pi is working and we can create a variable here called
window and we can see signal over here dot H eight and 400 windows and we can pass the number of points
we want.
Let's say we want to create a fifty one point one in window.
I just hit this like this.
It says has no attributes.
Yeah I typed three ends.
Sorry about that.
Really sorry.
Bear with me.
So we can see a window cause signal dot HK and over here I typed three and that's why the arrow was
given and then I passed the the window pass the number of point fifty one then just for fun this plot
the window I see I can see P L T plot window
and then peyote that show and indeed this is what Han in window looks like.
So yeah we've got all the packages we need for this cause we've got num pi we've got multiple lib and
we've got CI pi.
So we are done with installation stuff all we have to do now is get started with some actual Python
code.
So this order is for this lesson and if you have any questions just send me a message or leave it in
the questions area and I shall see in the next lesson.