So to start up a Jupiter notebook we type in Jupiter notebook.
And don't worry if you're not sure what a do and notebook is we'll have a section on that which goes
through how you can use Jupiter notebooks or you need to know for now is that a Jupiter notebook is
somewhere where you can write Python code especially machine learning and data science code and write
text around it and share your work with others.
It's kind of like a big work pad that you can use and just pass it around online.
We'll have plenty of experience with that as we go on.
We'll hit Enter now what that Jupiter command not found.
Why is that.
Well we go over here where we ran the command before for com to create.
We had map plot lib pandas known pi psychic loan but we missed out on the Jupiter package hard on this
guy.
Did we install the Jupiter package.
We didn't map what lib num pi panders socket line.
No Jupiter.
So that's why it's come back.
Jupiter command not found.
So how do we fix this.
Well again we can use our personal assistant conduct Conda install now install is a command where it's
like OK I'm missing a package and I want to use it and package I went missing a tool then I need to
use it so I'm going to say conduct install this tool for me in our case we want the Jupiter tool so
conduct install Jupiter.
Now of course we couldn't type this up here before but I've I've missed out Jupiter on purpose so I
could show you this cone to install we could put Jupiter here on the end after cyclone but we're going
to run it here into now again this is gonna go Condor is gonna it's gonna tell condo we want Jupiter
it's gonna query the Internet and com is like okay the following new packages to use Jupiter I'm going
to install all of these for you.
We're going to hit.
Yes.
Thank you.
Conda and this is gonna take a few seconds again now I know this is this is getting to be a long process
but once we've gone through this we'll be able to to automate this to almost just one line of code so
in the future for future projects.
Once you understand that the concept of creating a project folder creating an environment will just
be out to make it nice and simple and do it in one step.
For now we're just going through it step by step so we can get the concepts as well as get a baseline
environment set up for our future projects.
And trust me it took me a long time to get these concepts so don't go thinking oh Daniel is entering
these codes and he knows what to do is it.
Well it's only because I've had a little bit of practice with this or I'm that I know this setting up
environment is one of the biggest problems that we ran into working on a team of machine learning engineers.
So once you get this down pat everything else becomes a breeze.
Not really but but yeah you'll see.
Okay.
So what did we just do then.
We ran the command condo install Jupiter.
Now we're not going to run that again.
But what do you think this has done.
We go back here.
We've got our project folder.
We've got our environment folder.
Now if we had might get rid of this one because that's not we're going to install now we've got this
in our environment that was kept first but we'll see that we don't need that for what we're doing now.
We can use that in another project.
So what have we done.
We've got now an environment that we've created with Jupiter map politely panders so I get line and
num pi.
Now what you need to know is we're going to use Jupiter notebooks and we're going to use these tools
for the majority of our data analysis step.
So this is kind of what we've just set up we've set up an environment with these tools.
But there's no use just talking about it let's see it.
What can we actually do now.
Now we've got Jupiter.
Can we run the Jupiter notebook Come on we tried to before Jupiter notebook.
If we've done this right there should light up the Jupiter interface.
Beautiful.
And we're going to go through this in a future election.
But for now what you need to know is what we can see here is the M folder.
Why can we see that.
Well if we go here the M folder this is what we're seeing.
Let's click on this one so it's got all these things been kinda meta dark cetera etc. Same thing Ben
Condamine are dark et cetera.
If we don't have to worry about that contest taking care of that this is our environment with all our
tools in it.
What we care about for making Jupiter in Jupiter is interface is creating a new Jupiter notebook.
You can do that over here for Python 3.
Let's try it out.
So this is going to create an Egyptian notebook and look.
This is our workspace.
You're gonna get very used to using this beautiful interface I actually really love the Jupiter notebooks
so you can write code.
It's Python code right.
So you can do one plus one you can do print Hello Hello World.
So you can do a few things and you can even write full functions we're not going to do that because
we're just focusing on seeing if our environment is set up.
Now there's a few more steps that we can do.
One more step really.
We can do to check it.
Now remember we've installed Matt what Panda's socket line and num pi into our environment and we've
ticked off Jupiter because this is a Jupiter notebook so we've ticked that off.
Now we want to check if these are available.
How do we do that.
Well we can import them but import is saying hey Python go and grab these tools so I can use them in
my notebook.
Import pandas as baby now pandas get shortened to PD because it saves us typing out pandas a lot.
So just just know that pandas we never ECPAT it probably means pandas import num pi as MP number unplug
it shouldn't an MP import mat plop lib dot dot dot pipeline as BLT.
Now the plots we want to make are from the pipeline module of Matt pop lib.
And that gets shortened to P L T import S.K. line which is short for cyclone.
All these all these little acronyms.
Don't worry about knowing them too much off my heart.
For now you can just copy copy and paste this sort of stuff I'll make sure there's a demo notebook in
the in the resources section.
But to test this we're going to hit shift and enter shift and enter is how you run a cell in June but
I watch as that number goes up on the left.
Three four four five.
We'd do another one escape B creates a new cell.
It will we'll learn all these in Juba so print Hello beautiful.
That's gonna be cell six because that's how many cells we run.
So this one should be seven if we hit shifting into
excellent.
Now why did this work.
Well remember the code that we ran we're not going to run it in terminal again but it's gonna be conduct
create prefix.
This line of code is what helped us set this up prefix pandas nullify that lovely psychic line.
What we've done is we've created a condo environment in our sample project folder and we've installed
pandas name pi.
Map plot psychic learn but then we tried to run Jupiter but we couldn't.
So we used Conda installed Jupiter and then we could access this Jupiter notebook.
So that's the workflow.
We have our computer.
We downloaded mini Condor which came along with Python and Condit came along with many content.
So then we came into this one and what we did on our computer was we created a project folder and then
within that project folder we used Conda to create an environment which now contains these tools.
So what does that mean.
Well that means that we can now use this environment to work with our data and start to build machine
learning models start to analyze data.
And because we've done it with Conda if we wanted to share our environment with someone in the future
we can but they take my word for it.
Let's go back over to to find out.
We look in the sample project folder.
We've got EMD and untitled AI pi and Bea that stands for AI Python notebook which is the old name for
Jupiter notebooks.
So now our notebook with all of this code that we've just done is also within our project folder.
You starting to see the value of having everything in one place and now we could just go Hey friend
or colleague or anyone else that you want to share your work with.
Send them this folder and make sure the folder contains our environment which is the tools we use.
So our workbench and the code we're going to write well we don't have much code but it will send it
will send this across to our to our colleague or team.
Now there's one more thing before we finish up and that's closing an environment and exiting Jupiter.
So when you start a Jupiter notebook We're back in terminal here.
It'll have all these come up in in your terminal.
Now to get out of it to close your Jupiter notebook down you might do this at the end of your day or
whenever you're finished work and you want to start a new project or work on another project.
We're gonna hit control and see at the same time that control and see whenever you're in terminal or
something like that is like saying Hey kill the current running process we're going to do that control
see shut down this notebook server yes we're going to hit yes or maybe we timed out for that we'll try
again.
So he's shutting it down now we're going to see a connection failed here because we're no longer connect
to our Jupiter notebook which makes sense because we just shut it down.
That's okay but you see we're still back in our environment we've got our environment active now safe
for example we wanted to change to another project so another project of this in a different environment
we want to exit the one where we're currently in to go to another one so we can go conduct to deactivate
environment you type conduct deep activate which is telling conduct pain exiting out of the environment
I'm currently in because I want to go into another one.
So we'll do that kind of deactivate.
Now look we're back to base.
So if we go to conduct and less that'll tell us the list of violence we have we have base.
Now when we downloaded mini Condor remember how I said it comes with the bare essentials What do you
think would happen if we tried to run a Jupiter notebook from the base environment let's try Jupiter
come out not found.
Why is that.
Well because remember when we created this environment we installed Jupiter base doesn't have that it
has the bare necessities.
We had to create our own custom end before we could access Jupiter.
How will we get back into this back into working on our project.
Now these steps I'll include in the resources section but this is what you'll probably get most used
to when working on different projects.
So we go here to activate the conduct.
We wrote this one down earlier conduct activate which is saying Conda Hey activate my environment called
this one we're going to type that out uses yours might be different remember this is custom depending
on what you've labeled your your projects or your environments.
The standard name is and though so that might not change.
This project will forward and might change depending on what project we're working on and this user
might change depending on on your actual user and your money you know not even have it on the desktop.
So remember this line of code will be custom depending on your own settings.
We're going to enter.
So see how we've just changed from base back to this.
So now we're active in our AM.
So if we type in Jupiter notebook.
Remember this is the workflow.
Jupiter notebook.
We come back we're gonna see this is the but interface and this is the notebook.
We created five minutes ago.
And we come in here now whenever you come back to a Jupiter notebook.
These cells are going to reset.
So one two.
That was just five.
That was six.
Now it's gonna be three.
This will be for and again we're gonna have a whole section on Jupiter notebooks.
But this is the main thing we need to remember for now beautiful.
We're back in our environment back working.
Let's just do a quick recap of what we've actually done have our computer.
That's what we started with.
We downloaded many content which came along with conduct and we come into this one.
We wanted to set up an environment to work on our heart disease project so what did we do.
We had our computer.
We created a project folder on our desktop called sample project and then we used Conda to create an
environment and install these tools.
Jupiter map pot lib num pi panders psychic learned into our environment and what we were left with.
We come back to find out.
We've got an environment folder within our sample project folder and a Jupiter notebook with some template
code.
Now you'll see in the future projects that these lines here are going to form the basis of many future
projects.
These these four tools themselves like are fundamental to machine learning and data analysis as a whole.
So you'll probably get very familiar or you will get very familiar if you go through this course importing
them and using them but that's enough for now.
Remember if you get stuck check the resources section don't forget to look at something like this flowchart.
There's also a blog post that goes along with him but that'll all be in the resources section.