Welcome back.
In the last video we went to the mini Conda home page or downloads page.
Remember this is for windows and we downloaded the Windows version Python three point seven of many
Conda and installed it to our computer.
More specifically this is what we did download ring counter installed to your computer.
Now for this lecture we're going to take care of these steps.
Test the installation create a project folder create a custom environment within activate your new environment
install Jupiter low to Jupiter notebook.
Now again I realize you might be seeing in Daniel this a whole lot of steps.
I just want to get into coding and you're right.
I'm the same with these sort of things.
But trust me setting up this workflow is what we're doing.
You know your computer going to create a project folder and then build an environment using Conda an
environment which contains all of our machine learning and data science tools.
It's gonna be foundational and Paramount for future projects going forward.
So let's do it.
Now we've gone through the download steps of many conduct and installed it to a computer we can check
to see if it's there by typing in search and looking for something called an icon to prompt many Conda.
This will be here once you've installed many condo.
So we're going to click on that.
There we go.
And then what you're seeing here is this Anaconda.
From what it's referred to in Mac OS Is it terminal.
But it's essentially a little part of your computer a little program where you can type in code and
have your computer execute it.
So what this means is this little section here is called the M prompt.
Remember we're setting up an environment base is the default environment that gets installed automatically
when you download mini Conda and subsequently conduct this here is the file path that we're in.
So I'm on the C drive in the users folder in the user's folder.
Daniel yours might be slightly different depending on what your name is.
So now we've got this setup.
First things first is that we need to create a project folder so let's do that.
To do so we're going to have a look at what current folders exist in the folder.
Daniel and we can do that in Windows by pressing D I R which stands for directory and that's going to
list out a series of folders.
And if we wanted to see these you might be seeing this is the first time and thinking oh my goodness
this is this is a bit confusing but let me show you what exactly it's printing out we go into the file
browser here and go to P.S..
Now we want to copy this to c c users.
Daniel.
That's what we're going to look for.
I'm going to go to the local DSC users because member we have users here.
Now we're going to our users Daniel so if we actually type this out C slash users slash.
Daniel it's the same as what we can see over here.
So now if we can pare this list here and we have 3D objects contacts desktop documents downloads etc.
What we want to do is for this use case we're going to create it in the we'll create it on the desktop.
So we have easy access to what I mean by this is going to create this project folder which is just another
one of these which is going to contain all of our project information on the desktop.
So we have easy access to it.
So let's change to the desktop.
What I mean by that is see how this path is using slash Daniel to change to the desktop.
I'm going to press see the desktop.
What CDE stands for is change directory to the desktop.
So now if I go the IRR which is going to list all the folders on the desktop it's going to show me sample
projects if we go on desktop.
You've got sample project.
Now we're gonna be creating another one of these.
So you might not have this already but this is what we're gonna be creating we'll call it sample project
one for this lecture.
I've already got a demonstration here that will create a new one.
So to create a folder we can type the command m k d IRR which stands for make directory because we're
going to call it sample project 1.
That's what we tell us.
So we're telling our computer hey we're in this drive we're in the users folder or in Daniel we're on
the desktop and I want to make a directory called sample project one going to hit enter.
Now you can see that is created sample project on we'll go back here.
So what have we just done.
Well we've done the first step.
We've created the project folder.
So now we're going to use Conda to build this environment.
If we go back to our flow flowchart create a project folder and change into it.
So that's what we have to do created the project folder but we're not in it yet.
So we need to change into it.
Remember to change directory and press S.D. into sample project 1.
So now this is what we have we have we're in here.
We're on the desktop.
We've got sample project 1.
And if we go desire to see what files are in here there's actually nothing in here so zero bytes zero
files.
If we look sample project 1 This folder is empty.
So that makes sense.
Okay now what's the next steps changed into it.
Create a custom environment within the project folder.
Well let's do that so to use Conda to create an environment.
Remember if we look at this we're going to use Conda to create this.
So that's this step you can run the command conduct.
It's like saying hey conduct our personal assistant create.
We're gonna pass it the prefix tag.
Now I'm gonna write this and slash and hand as Num pi map but lib and socket line you might be looking
at this going my goodness Daniel what what is going on here.
Well that's a great question.
So remember what we're saying is conduct.
Hey personal assistant conduct create.
Actually that was a bit that was with me and not yelling that pretend this is saying Please conduct
create prefix when you see these double hashtags it's like a little command that can go to the create
function.
This dot means it's going to use this file path here.
So essentially saying the DOT saying within the sample project one folder and create a folder called
M and within that end and this shortfall environment which is this within that end install panders num
pi map plot lib and socket learn.
Now what are these.
Well if we look here at what lib num pi panders socket line.
So let's run this by pressing enter and see what happens
so now our personal assistant conduct what just happened.
A whole bunch of code just appeared.
Because we've we've ran this command here.
Conduct create prefix and etc. What this is going to do is conduct our personal assistant for collecting
data science tools.
Remember these are data science tools.
Here is going to go to the Internet and download or query the Internet and go Hey Daniel wants to create
an environment on his computer with map plot Labor num pi pandas and psychic line.
And so the following packages will be downloaded.
This is a message from Canada.
All we did was press enter what Canada is going to do is because these packages themselves or these
tools require some other tools within them to operate.
So lots of code lots of the reason why is because people have written lots of code in the past to prevent
rewriting all the code.
A lot of existing tools leverage another bunch of existing tools so conduct is automatically.
So this is a beautiful thing about content.
It's going to download all of the extra tools that we need to get started.
And this is what this is listing out here so we want to proceed to do so we'll press why now conduct
is going to download and extract extract means install all of the packages it requires to get set up.
So now this might take a minute or so or maybe a little bit longer depending on your internet connection
or hard drive speed.
So I'll let this run through and we'll resume the lecture once it's finished
excellent conduct has now finished that took a few that a minute or so on my computer.
What is actually done is it's gone to the Internet it's downloaded and installed these packages.
So a big long list of them into our environment and let's have a look over here.
So this is what it's done.
Create a project folder.
Now we've asked Condi using the com to create command to create this environment.
So if we go back to our sample project one folder there's now a folder in here called in which is remember
short for environment we go in here by clicking here.
It's gonna have a whole bunch of different files in here.
Now to be honest I don't even understand what's going on in here.
What is important to know is that this contains all of our data science and machine learning tools.
So now we have a project folder with an environment with all our tools ready to go so to access that
environment and to access the tools that we want to use.
Condit tells us to activate this environment.
Use the command contact activate C users Daniel.
Desktop sample project 1.
And now you might want to write this one down.
If you're doing this for the first time you also might be slightly different to mine.
Your user name might be different and you might have called this something else because you can call
this whatever you like.
You should really call and always call M M.
That's a universal name for or shortened version of environment to activate this environment that we've
just created we can use this command and now I'm a big fan of typing out commands.
So we're gonna go instead of just copying and pasting which we could definitely do but this practice
typing out these things because we want to.
After all that's what we want to do we want to start writing our own code and type this out sample project
one slashed end run.
Now what you'll notice has changed so I just literally just type this out and press enter.
If we hit Enter you'll notice this base has now changed to this file path here which means this is the
environment prompt.
So now we've activated this environment.
What that means we'll have access to all of the tools in this environment.
So the ones we just installed so let's try and test it out to do so we'll try and load a Jupiter notebook
using the command Jupiter notebook.
And if you never use a Drupal notebook before don't worry.
That we a section on that but a Jupiter notebook is what you need to know is kind of like a data scientists
work pad you can write code you can write.
You can write text you can work on projects in fact all of the projects we work on will be within DuPont
notebooks.
It's like the basis of all of our machine learning work.
So let's try and start one up.
Okay.
We're getting an error here.
Jupiter is not recognized as an internal or external command.
Now the reason being is if you remember the exact code that we ran before and it's okay if you don't
we did Condit create prefix and pandas known pi map Gottlieb psychic line.
Mm hmm.
So we go back to our diagram what do we have pandas now what label non pi socket line but no dupe at
all.
We forgot to include Jupiter in this line.
Not to worry Conda our personal assistant is back to the rescue because there's a handy command called
Connor install what this means is if we type in Jupiter.
Connor install is going to install a new tool to our current active environment which is exactly what
we want and since we want to use Jupiter notebooks we need the Jupiter package.
So let's run that by hitting enter
Connor is gonna do the same thing as what what it did before we go up here we've seen all these before
except this time it's only focused on Jupiter in the environment location uses Daniel desktop sample
project 1.
So if we follow this through it's gonna install all of these extra packages because Condor is amazing
it's our personal assistant and all these packages are tools that we need for data scientists and we
go why to run.
And again it's gonna go through these download and extracting stamps will pause the lecture wait for
this to finish and we'll come back once it's done.
Beautiful.
Now that that's finished we should have access to Jupiter.
Let's let's do a quick recap of what we've done.
So we've created a project folder changed into it.
That sample project 1 Create a custom environment.
We've done that with com to create activate our new environment.
Yeah we've done that with to activate install Jupiter because we tried to access Jupiter but it didn't
work with Conda installed Jupiter.
Now we have to load up a Jupiter notebook and check the tools we need.
OK let's try that.
So if we've actually installed Jupiter should be able to run the command again Jupiter notebook the
one we tried before that didn't work.
We'll type that in Jupiter notebook and hit enter.
So now what this is going to do is going to automatically open your browser your default 1 and launch
the Jupiter interface so we can see here a few maybe a few new things here.
If you've never seen it before what's important to note is that the Jupiter interface has been created
from within the folder that we're currently in on terminal so uses Daniel desktop sample project 1 Jupiter
notebook.
It's like telling your computer Hey started Jupiter notebook within the sample project one folder.
So we look here we've got the end folder we compare that to our sample project one we've got the end
folder as well.
Now to start a Jupiter notebook where the workspace where a data scientist or machine learning engineer
will do a lot of coding working on different projects go up to here new notebook Python 3.
And again we're going to have a whole entire section on Jupiter notebooks.
So don't worry too much if you're not sure what's happening here.
So what this is going to do once happened here oh there we go.
They just took a little while to load.
So what we did there we've actually got to because that took a.
There was something going on there with my computer and it took a while to start up.
There we go Untitled I pi and b stand so I Python notebook which was Jupiter's previous name.
And so this is the Jupiter interface.
Absolutely beautiful space we're gonna get very familiar with using this throughout the course.
And again we're gonna have an entire section on this.
But what you need to know for now is that you can run Python code in here.
So hello world and then press shift and enter and that'll come through.
This is this cell in Jupiter notebooks.
This is referred to as a cell you can also change it to mark down which is like saying text and say
this cell does simple some and the one below is going to be one plus one shift and into.
Well what we're focused on doing is testing to see if our environment is set up.
So specifically we've ticked off Jupiter we've got access to Jupiter because we're in the Jupiter interface.
Now we want to see if we have access to pandas psychic line none pi and map probably we can do that
by importing them.
And remember the import statement is like saying hey Python go and get these packages or tools for us
and bring them into our workspace so we can access them.
So do import pandas as PD import num Hai as any import map plot lib dot pie plot no pipeline as BLT
import as K line which is short for socket learn.
Now these might be like pandas is paid a want and num PIs MP might apply plot.
The reason why we shorten it to these things is so we don't have to always type pandas.
Now if you ever see PD or NDP LPL t you can probably be safe to assume that their pandas name pi met
properly or pipeline to test these if we actually do have access to them in our environment is set up
we can run this cell and if there's no errors we should have an environment ready to start doing data
science and machine learning work.
Fingers crossed beautiful.
We can tell it.
There was no errors because you'll see a number here every time you run a Jupiter cell we'll go over
this and in a future lecture the number will go up so the first one you run will be one that's seven
now because we've run seven different cells but this is exciting we've just set up an environment to
work on machine learning and data science projects let's have a look.
We started with this your computer and we downloaded mini conduct which came with Python and conduct
then we used Conda to install these tools specifically within an environment.
Now if we go back here we've gone through these steps in a previous lecture we downloaded installed
mini Condor we tested our installation by the anaconda prompt we created a project folder sample project
one and changed into it created a custom environment within the project folder we activated the new
environment.
So we have access to tools we installed Jupiter then we loaded up a Jupiter notebook and check to see
if we had the tools we needed which we did.
Well that was a lot to take in.
Don't worry I will have plenty of practice going through this in future projects and in lectures.
So what do we do now.
We've got our Jupiter notebook running.
But maybe you want to.
You've finished for the day and you want to close it.
What I've just done is saved so to save a Jupiter no boat.
You can either click this Save icon and that'll that'll save it once it loads or you compress command
air so control s or something like that.
But to close it down we go back to our Anaconda prompt and we're going to press control see
so there we go.
Press controls say now it says shutting down one colonel Colonel shut down the colonel is what runs
our troop at a notebook in the background.
So now you'll see here that the connection has failed to our Jupiter nightfall.
So we'll go okay.
That means that Jupiter notebook we're no longer connected to it.
So we're back here and we're still in our environment.
But to deactivate the environment maybe you wanted to get out and create a new environment.
So we're gonna type in conduct deactivate what this will do is take us back to base.
Now why would we want to do that.
Well maybe we want to create a new environment.
Maybe you want to work on another project such as sample project 2 and that uses a different environment.
It might be a plethora of reasons.
However how do you get back into your environment.
Well luckily we wrote down that piece of code before if he didn't.
It's okay.
It's to conduct activate.
See we're going to write this this and slash EMP.
Now this is if you are coming back to your work and wanted to get back into your project.
Daniel slash because this is where we created our environment sample project 1.
Now this might be in the future might be a sample might be project to maybe project 3 or something like
that.
We usually have and that the end here to conduct activate our environment beautiful now a back from
base to having our environment active so then we can type in to put a notebook load back up a Jupiter
notebook is going to take us to the home page.
There we go.
We've got our Untitled I Spy and B which was saved two minutes ago.
Click on that
and there's our code from before.
So then we could continue work on our project save it when we need to and exit when we don't need to
work on it.
Well we're gonna see this more and more for each single project that we work on.
What's important to remember is that this is what we've done we've set this up for the future.
We have our computer.
We've created a project folder.
Say we wanted to work on heart disease classification.
We'd make a folder for that.
You create an environment install the tools that you need using Conda.
Then if you're working by yourself you might not need to do this but in the future when you're on when
you're on teams this is one of the biggest challenges we work through as a machine learning team.
Sharing these environments so other people could work on the same projects as us.
So that's what we've done.
So upcoming lectures and projects we're gonna do the same steps create a project folder build an environment
with the tools we need using Conda and then every time we're going to go in activate our environment.
So we have access to the tools and then work on our projects in Jupiter notebooks.
That was a lot to take in but don't worry there's attached resources.
And if you want re watch this video go through it step by step.
Check out the resources section for a step by step guide.
And if you get stuck Don't worry I've got stuff plenty of times when I was figuring this out.
It took me a few guys.