Over the next couple of lessons we're going to talk about Python programming in depth. 1
The aim of this section is to make sense and explain the code that we wrote in the previous lessons 2
when we were estimating the movie revenue. 3
As such, the next lessons are not going to teach you more machine learning concepts. 4
Instead, the lessons will focus on the Python programming fundamentals. 5
We're going to take a deep dive into the Python code that we wrote for visualizing our data and for 6
running our regression in the Jupyter notebook. 7
What Python programming fundamentals will we look at? 8
We're going to discuss programming concepts such as variables, data types, functions, methods and objects. 9
These are the fundamental stepping stones on which all the other future lessons are going to be built. 10
For these lessons, 11
I will assume no prior programming knowledge. 12
So if you've already got some programming experience feel free to skip ahead through the upcoming videos 13
or just watch the videos at double speed. 14
Now I also tried really really hard to find you guys some interesting data sets for us to look at. And, 15
I came across a pretty weird medical study that was done in the United States in 1968. 16
So for our programming exercises, we will use the data from this study which examines how math test scores 17
were affected by the use of psychedelic drugs. 18
Now, without further ado, let's jump straight into how to get set up. 19
Let's fire up a new Jupyter notebook. 20
This time we're going to use the locally installed version instead of the try.jupiter.org 21
web site. 22
Now there's different ways you can do this. 23
First let me show you how to do it with the Anaconda Navigator. 24
So simply open the Anaconda Navigator and then click on "Launch" Jupiter notebook. At this point, 25
the Jupyter notebook will open in your browser but you'll notice if you look at your address bar, instead 26
of it reading try.jupiter.org, 27
it will read localhost. The other way to open a Jupyter notebook, without going through the Anaconda 28
Navigator is simply by going through the terminal or the command prompt. 29
First, let me show you how to do this on a mac. On a Mac, 30
you'd open the terminal 31
and then you would type "jupyter notebook" and hit Enter and you'll get exactly the same result as going 32
through the Anaconda Navigator. 33
Since loading the Anaconda Navigator can be a bit slow at times, 34
I actually prefer this as a way of getting to the Jupyter notebook very, very quickly. 35
Now, if you're running a Windows machine, you don't have a terminal. 36
Instead, you'll have something called the command prompt. 37
In fact, when you installed Anaconda, it would have actually given you something called the "Anaconda prompt" 38
as a convenient shortcut. You'll find this Anaconda Prompt in your start menu. 39
So if I go to show all my apps, it's right here - Anaconda prompt. 40
And this is what it looks like. Since I use this Anaconda prompt quite a bit, 41
I've actually pinned it to my taskbar for easy access and this is what I'll recommend for you guys as 42
well. In the Anaconda Prompt, 43
you simply give the same command as on Mac. 44
You're right - "jupyter notebook". 45
When you hit enter, the Jupyter notebook should fire up in your default browser. 46
Now, what we're gonna do is we're going to create a folder where we're gonna save all our work and we're 47
gonna call this folder MLProjects. The way to create this folder is to go to New and then go to New 48
Folder. 49
You should then see an untitled folder appear. 50
But instead of leaving it as "Untitled Folder", you're going to put a tick box next to it and then you're 51
going to hit "Rename". 52
And here you're gonna give it the name MLProjects and confirm, so click on your MLProjects folder 53
to open it. 54
And then once inside you're going to create a new Python notebook. 55
Click on "New", then "Python 3" 56
and then let's rename this notebook to "02 Python intro", hit "Rename" and then let's navigate back 57
to the MLProjects folder. 58
You've probably done some work in the previous lesson when we were working on try.jupyter.org 59
and you've probably downloaded your notebook at the time. What you can do now is upload that notebook 60
to your MLProjects folder. 61
That way you can keep all your coursework together. 62
So just click "Upload". 63
Select your Python notebook and select the cost_revenue_clean data set as well - 64
that CSV file that I provided previously and then click "Open". 65
You should see the two line items appear in your MLProjects folder where you can confirm by hitting 66
the blue "Upload" button. Now you've got your previous work accessible here together with the data set 67
that we used. Great! 68
Now we're all set to dive into Python programming.