‫Welcome back.
‫In the last video, we went to the Mini Conda homepage or downloads page.
‫Remember, this is for Windows and we downloaded the Windows version Python 3.7 of Mini Conda and installed
‫it to our computer.
‫More specifically, this is what we did.
‫Download Anaconda.
‫Install it to your computer.
‫Now for this lecture, we're going to take care of these steps.
‫Test installation, create a project folder, create a custom environment within.
‫Activate your new environment.
‫Install Jupyter Loaded Jupyter Notebook.
‫Now again, I realize you might be thinking, Daniel, this is 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.
‫We've got your computer, we're 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 going to be foundational and paramount for future projects going forward.
‫So let's do it now.
‫We've gone through the download steps of Mini Conda and install it to our computer.
‫We can check to see if it's there by typing in search and looking for something called Anaconda prompt.
‫Mini condo.
‫This will be here once you've installed many conduct.
‫So we're going to click on that.
‫There we go.
‫And what you're seeing here is this anaconda, from what it's referred to in Mac OS is a terminal,
‫but it's essentially a little part of your computer, our 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 MX prompt.
‫Now, remember, we're setting up an environment.
‫This is the default environment that gets installed automatically when you download Mini Conda and subsequently
‫Conda.
‫And this here is the file path that we're in.
‫So I'm on the C drive in the users folder, in the users folder.
‫Daniel Yours might be slightly different depending on what your name is.
‫So now we've got this set up.
‫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 R, which stands for directory and that's going to list out
‫a series of folders.
‫Now, if we wanted to see these, you might be seeing this for 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.
‫We can go to PC.
‫Now we want to copy this.
‫So you see there's see users.
‫Daniel That's what we're going to look for.
‫I'm going to go to the local DC users because remember we have users here and then we're going to go
‫users.
‫Daniel.
‫So if we actually type this out, see slash user slash Daniel, it's the same as what we can see over
‫here.
‫So now if we compare this list here, 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 it.
‫And what I mean by this is we're 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.
‫And what I mean by that is see how this path is uses slash Daniel to change to the desktop.
‫I'm going to press see the desktop.
‫What CD stands for is changed directory to the desktop.
‫So now if I go I.R., which is going to list all the folders on the desktop.
‫It's going to show me sample projects.
‫If we go on desktop, we've got sample project now we're going to be creating another one of these.
‫So you might not have this already, but this is what we're going to be creating.
‫We'll call it Sample Project One for this lecture.
‫I've already got a demonstration here, but we're creating a new one.
‫So to create a folder we can type the command m k dear which stands for Make Directory because we're
‫going to call it Sample Project one.
‫That's what we tell them.
‫So we're telling our computer, Hey, we're in this drive, we're in the users folder, we're in Daniel,
‫we're on the desktop, and I want to make a directory called Sample Project one.
‫We're going to hit Enter.
‫Now you can see that is created.
‫Sample Project one.
‫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.
‫And if we go back to our 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 proceed into sample project one.
‫So now this is what we have.
‫We have we're in here, we're on the desktop, we've got sample project one and if we go down to see
‫what files are in here, there's actually nothing in here.
‫So zero bytes, zero files.
‫If we look sample project one.
‫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, Conda.
‫It's like saying, Hey, Conda, our personal assistant create and we're going to pass it the prefix
‫tag.
‫And now I'm going to write this out.
‫Slash env pandas num py map plot 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.
‫We're not actually.
‫That was a bit that was a bit mean.
‫We're 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 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 env.
‫And within that env and this shortfall environment which is this.
‫Within that env install pandas numpy map, plot lib and socket learn.
‫Now what are these?
‫Well, if we look here, map pop lib numpy pandas, socket, learn.
‫So let's run this by pressing enter and see what happens.
‫So now our personal assistant, Condor.
‫What just happened?
‫A whole bunch of code just appeared because we've we've ran this command here, con, create, prefix,
‫env, etc..
‫What this is going to do is konda 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, lib numpy,
‫pandas and cyclone.
‫And so the following packages will be downloaded.
‫This is a message from Conda.
‫All we did was press enter.
‫What Conda 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 and to prevent rewriting
‫all the code, a lot of existing tools leverage another bunch of existing tools.
‫So Conda is automatically.
‫So this is a beautiful thing about Conda.
‫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 Conda is going to download an 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.
‫Kunda has now finished that took a few about 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.
‫Now let's have a look over here.
‫So this is what it's done.
‫Create a project folder.
‫Now we've asked Conda using the Conda 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 Env, which
‫is remember short for environment.
‫We go in here, we click in here, it's going to 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 con to activate C users.
‫Daniel Desktop Sample Project one m.
‫Now you might want to write this one down.
‫If you're doing this for the first time, yours might be slightly different to mine, your username
‫might be different, and you might have called this something else because you can call this whatever
‫you like.
‫You should really call MV Always call me M That's a universal name for or shortened version of environment,
‫but 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 going to go instead of just copying and pasting,
‫which we could definitely do, but to to 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 I'm going to type this out.
‫Sample Project one slash EMP run.
‫Now what you'll notice that's 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 will 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 Jupyter Notebook using the command.
‫Jupyter Notebook.
‫And if you've never used a Jupyter Notebook before, don't worry, there'll be a section on that.
‫But a Jupyter Notebook is what you need to know is kind of like a data scientist work pad.
‫You can write code, you can write, you can write texts, you can work on projects.
‫In fact, all of the projects we work on will be within Jupyter Notebooks.
‫It's like the basis of 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.
‫Com to create prefix m pandas num pi map plot lib cyclone.
‫Hmm.
‫So if we go back to our diagram, what do we have?
‫Pandas map plot lib num pi cyclone.
‫But now, Jupiter, we forgot to include Jupiter in this line.
‫Not to worry.
‫Condi, our personal assistant, is back to the rescue because there's a handy command called Conda
‫install.
‫What this means is if we type in Jupiter Conda 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 Jupyter Notebooks, we need the Jupyter package.
‫So let's run that by hitting enter.
‫Conde is going to 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
‫users, Daniel Desktop Sample Project one And so if we follow this through, it's going to install all
‫of these extra packages because Condor is amazing.
‫It's our personal assistant.
‫And remember, all these packages are our tools that we need for data scientists and we go, Why?
‫To run.
‫And again, it's going to go through these downloading and extracting steps.
‫We'll 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.
‫So let's let's do a quick recap of what we've done.
‫So we've created a project folder, changed into it.
‫That's sample project one.
‫Create a custom environment.
‫We've done that with com to create activate our new environment.
‫Yep.
‫We've done that with activate install Jupiter because we tried to access Jupiter, but it didn't work
‫with Conda.
‫Install Jupiter.
‫Now we have to load up a Jupiter notebook and check the tools we need.
‫Okay, let's try that.
‫So if we've actually installed Jupiter, it should be able to run the command again.
‫Jupiter notebook.
‫The one we tried before, that didn't work.
‫So 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 one, 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 Jupyter interface has been created.
‫From within the folder that we're currently in on terminal so users Daniel Desktop Sample Project one
‫Jupyter Notebook.
‫It's like telling your computer, Hey, start a Jupyter Notebook within the sample project one folder.
‫So we look here, we've got the end folder.
‫We compare back to our sample project one.
‫We've got the end folder as well.
‫Now to start a Jupyter Notebook, the workspace where a data scientist or machine learning engineer
‫will do a lot of coding, working on different projects.
‫You can go up to here New Notebook, Python three.
‫And again, we're going to have a whole entire section on Jupyter notebooks.
‫So don't worry too much if you're not sure what's happening here.
‫And so what this is going to do.
‫What's happened here.
‫Oh, there we go.
‫It 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, P and B, which stands for I Python Notebook, which was Jupiter's previous
‫name.
‫And so this is the Jupiter interface, absolutely beautiful space.
‫We're going to get very familiar with using this throughout the course.
‫And again, we're going to 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 a cell in Jupyter Notebooks.
‫This is referred to as a cell.
‫You can also change it to markdown, which is like saying text and say this cell does a simple sum and
‫the one below is going to do one plus one shift and enter.
‫But 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, socket, learn numpy and map pop lib.
‫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 numpy as MP import map plot lib dot py plot lib pi plot as plt import
‫src line which is short for cyclone.
‫Now these you might be like pandas as PD what non pi's MP might ply 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 MP plt, you can probably be safe to assume that they're pandas num pi map,
‫plot loop or pi plot.
‫To test these.
‫If we actually do have access to them and 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 that there was no errors because you'll see a number here.
‫Every time you run a Jupyter cell.
‫We'll go over this in a 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.
‫Then we downloaded many Conda, which came with Python and Conda.
‫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 and installed many Conda.
‫We tested our installation via the Anaconda prompt.
‫We created a project folder sample project one and changed into it and created a custom environment
‫within the project folder.
‫We activated the new environment, so we have access to tools.
‫We installed Jupyter, then we loaded up a Jupyter notebook and checked to see if we had the tools we
‫needed, which we did.
‫Whew.
‫That was a lot to take in.
‫I don't want I will have plenty of practice going through this in future projects and lectures.
‫So what do we do now?
‫We've got our Jupyter Notebook running, but maybe you want to you finish for the day and you want to
‫close it.
‫What I've just done is saved.
‫So to save a Jupyter Notebook, you can either click this save icon and that'll that'll save it once
‫it loads or you can press command s or 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 c.
‫So there we go.
‫Press control.
‫See, now it says shutting down one kernel kernel shut down.
‫The kernel is what runs our Jupyter Notebook in the background.
‫So now you'll see here.
‫That the connection has failed to our Jupiter nine.
‫So we'll go.
‫Okay.
‫That means our Jupyter 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 going to type in Conda Deactivate.
‫What this will do is take us back to base.
‫Now, why would we want to do that?
‫Or maybe we want to create a new environment.
‫Maybe you want to work on another project, such a sample project too, and that uses a different environment.
‫There 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 you didn't, it's okay.
‫It's second to activate.
‫See, we're going to write this.
‫This app slash EMP.
‫Now, this is if you were coming back to your work and wanted to get back into your project.
‫Daniel Slash This is where we created our environment sample project one.
‫Now this might be in the future, it might be a sample, might be project two, might be Project three
‫or something like that.
‫But what we usually have at the end here.
‫So to activate.
‫Now environment.
‫Beautiful.
‫Now we're back from base to having our environment active, so then we can type in Jupiter Notebook.
‫Low back up.
‫A Jupyter Notebook is going to take us to the home page.
‫There we go.
‫We've got our Untitled IP and B, which was saved 2 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 going to 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.
‫You'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 was sharing these environments so other people could work on
‫the same projects as us.
‫So that's what we've done.
‫So in upcoming lectures and projects, we're going to 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 Jupyter Notebooks.
‫Okay, that was a lot to take in.
‫I don't worry.
‫There's attached resources and if you want rewatch 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 got stuck plenty of times when I was figuring this out.
‫It took me a few goes.