My First jupyter notebook Recorded Transcript This transcript was created with a speech to text software. Please excuse any typos or mismatches with the video. Welcome back. Uh in this video, we'll be continuing on with Python prep with our first Jupiter notebook. I'm gonna go ahead and share my screen that has the Jupiter Notebook in it and we'll get started. So welcome. In the last video we introduced you to our Python prep series. In this video, we're going to start by talking about Jupiter notebooks. So a Jupiter notebook is essentially going to be uh a nice work space for us to both uh write some stuff about code, try and code up some things and then execute that code and look at the output all within our web browsers. And so this is a Jupiter notebook. You'll notice that in my web browser, there's the little uh notebook icon up here indicating that I have a Jupiter notebook. Uh So these are nice because they have what are known as markdown chunks where I can write words using markdown. So think of markdown as sort of a Microsoft word in your web browser that can allow you to do additional things that word can't do, like have highlighted code chunks. Uh We can write things in mathematics like you're working in lach. Uh you can write uh have nice heads uh in a nice, easy way without having to change the font, the bold or anything like that. Uh And so this is gonna be what we work and do our data science lectures in our, a series of Jupiter notebooks. So this is a markdown block. What I have right here is a code block and then code blocks uh in our course in our boot camps, we'll be writing what are known as what is known as Python code. Uh which is what you're here to learn. The Python prep. Uh So Python code can be written and then if I want to execute code, I can hit shift and enter on my keyboard at the same time. And while it looks like nothing happened, you'll notice that here. A little one showed up and the word in. So what this is saying is that I ran some Python code. This is the input. It's the first time I've executed a code chunk. Uh And there was no output. So nothing happened. So what if I click here? And uh if you want to follow along and work, work with me, feel free to do so or if you just want to watch and then pause the video later and try and do it on your own, perfectly reasonable as well. So, what we're gonna do now is I'm gonna click on the second code chunk and again, I'm gonna hit shift and enter and now we can see in and then a two and then the output that came back was hello, friend. And that's because we wrote the Python code, which you'll learn soon. Uh For here's a string and I want to print it on my computer. Uh Just hello. All right. Now, here you're gonna practice and I want you to try and execute your old code and chunk. Uh And so if you want to pause the video now and try it on your own and then come back and watch me do it and see if you did it. OK? That's great. And I hope that you do so. OK? So what we're being asked to do is we wanna execute some Python code. And the simplest code that will work for us is something like two plus two. And now when I hit shift and enter, what should I see? I should see four. And so now I can see here that I have in this was the third code chunk I have executed and the output from that code chunk. Uh That third code chunk is a four. Now we have what we saw was a markdown chunk. We've had a few code chunks and now let's see how we can go between the two. So I'm gonna click on this code chunk and now it's currently a code chunk, but I actually want it to be a markdown chunk and So in order to do that, I'll go up here and I'll click this little arrow and I find a mark down and I click that. And now if I hit shift enter, you'll notice that it went from the blue text with some uh went from first one, from code to a markdown, then it went from blue text, which is where I was editing my markdown. So for instance, if I double click it again, I can say this is now a mark down junk. ... OK? Uh And now it is a markdown chunk. Uh This is what it looks like when you hit shift, enter on a markdown chunk, it executes it. So it looks nice on your web browser just like we went from code to markdown. I can go from markdown to code. So I double click on this markdown chunk and then I go up and for markdown to code and now I can execute it and we should already know what's gonna happen here. We have four uh nice things about Jupiter notebooks is we can execute some plotting and we'll get plots back. So here's a plot I made and we'll talk more about plotting later. So if you don't understand this code, don't worry about it, we're gonna talk about it later. Uh But now it's nice because uh in Jupiter notebooks, you can write some code to make a plot and then look at the corresponding plot right away and maybe I wanted to edit it and change it to a red line. I can do that super quickly. ... So before we end this video, it's really all you'll need to know about Jupiter notebooks to get started. But before we end, I want you to be mindful that in Jupiter notebooks, the order in which you run code chunks is very important. So if you run a code chunk A uh before code chunk B then everything that you did in A is executed and stored in your computer as needed. Uh And for B so if there is a say, let's say there you had code chunk like this, like we're gonna see in a second. So I've got two code chunks. If you see my little window here, the one down here was written so that it's dependent upon something that was written up here. If I accidentally execute the one at the bottom before the one at the top, uh I should get an error. And let's see, here's an example where I accidentally wrote some code in the wrong order. So here I'm saying, I want you to do two times X and I'm saying, let's run this first, but I get an error and that error is because I actually haven't in Python defined what X is supposed to be. And so if I run this X equals three and then try and go back and run two times X, I don't get an error. And so really the takeaway here is you just should be mindful of the order in which you're running a code junk. And in the future when you're writing your own code and trying to execute it, if you get an error, it might be worth seeing if you've run something out of order. I often find that that is the case for myself. So before I sign off on this video, a useful link for Markdown and Jupiter could be this I B N link. So here they give you a nice rundown of all the different things you can do. So how to get different headings, how to get bold and italic text, math symbols uh and so forth. OK? So this is a nice little guide that has uh for those of you new to markdown is very helpful. I found it helpful uh when I was new to markdown. OK? So that's gonna be it for this video. You now have an introduction to Jupiter notebooks and now you're ready to start learning about Python. I will see you in the next video. Bye.