Jupyter Notebook In 10 Minutes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
jupiter notebook in 10 minutes that is the name of the video you clicked on hey my name is colt let's uh let's slow it down that's kind of a lot of fast talking there jupiter notebook is one of the most commonly used tools in the world of data and data science and data anything and it also happens to be used in a lot of courses that teach those topics and what a coincidence i happen to have a course that just released that uses jupiter notebook it's a course on data analysis and visualization using python pandas matplotlib seaborne and more oh gosh i just love that advertising um yeah there's a coupon in the description if you're interested alright here we go jupyter notebook is a super popular tool that's used to generate and work with notebook documents these notebook documents combine code which is usually python but doesn't have to be with text elements and images and headings equations figures different plots the output of the code alongside the code itself and it's all in this very visual interactive format directly in your browser so here are some examples this is a notebook as it says there's text up here and then python code and i can run this python code let's look at my cat hates me 99 times or let's do something even fancier let's make a little 3d plot so it's going to take a moment but there we go would you look at this plot it's all in this notebook document we've got the code alongside the output generated by that code plus bullet points and text and videos and images and whatever else we want fancy equations audio all this can go into a notebook document they're very popular in the world of data because we can view charts and plots things that you don't need jupyter notebook to create but we can create these sort of reports we can analyze data with code and generate some end results that we can then disseminate to people so you can't really run python in the browser natively the way that it all works just really quickly you type some code in some cell in a notebook you execute it well the browser sends it off to a notebook server which is running in the background and then it interfaces with whatever kernel the default is python 3 but as i said you can have other languages but python3 will then evaluate whatever code it received send that output back and then our browser displays it for us to look at so we get that nice looking chart from that code so that's a basic concept next up installation so this is not going to be an install video but i'll just quickly run through your options you have a couple first you can just install it just as you would install any other python package with pip and deal with virtual environments but another option is to use anaconda so anaconda comes with a bunch of different packages and different tools all you need to do is go to anaconda.anaconda.com individual edition download and open up the app when it finishes installing and you'll see something like this anaconda navigator this is the app that i just installed and one of these tools that we have in this navigator is jupyter notebook i'll click launch it starts a server up it opens my browser and i see the jupyter navigator the dashboard where i have a representation of my file system so all my messy folders and files downloads applications pets documents you can move around and create new folders and files but what i'm going to show you is how to make our first notebook so we can go to new python3 that makes me a python 3 notebook here it is it's untitled i can click here to give it a new title my very first notebook there we are and what i'm looking at now is a cell an empty code cell we can tell its code it actually says code right there and i can type some stuff in here like one plus eight and i can run this cell by clicking the run button that's the clunky way of doing it another option is to use the shortcuts so if i do something let's do 99 times 99 i can do shift return i can do control return or command return on a mac and i'll see the output right below the input the python code now uh there is a slight difference in those different shortcuts if i do shift return it's going to make me a new empty cell afterwards if i'm at the bottom so that can be useful if i know right after this four plus one i want another cell i can use shift return and it makes that cell and moves me down to it so i can click around to move to a different cell if i want to tweak this and instead do 1 minus 8 i can run it i just did command return on my mac i can also use the arrow keys to move up and down now notice i've got this blue cursor here showing me which cell i'm in but if i start typing like let's say in this cell right here at the bottom um i want to print out haha a hundred times just really simple stupid stuff if i start typing so i want quotes h hey what what's going on well i wasn't actually entering anything into this cell i'm not editing it i'm in something called command mode to actually start editing i either need to click in and it will turn green and there's a border around it or i just clicked out if to go back to this command mode or i can hit enter return and now i can type my code in here haha times 100 or whatever i said and then i'll run that so that's something that trips people up all the time let's say i want to tweak this cell here i want it to be a times a multiplication if i start typing it's not going to work i have to do enter to start editing that cell and then i can run that cell all right so next what can we do in this command mode what is the point of having that distinction between actually editing something versus just selecting it well there are many shortcuts we can use different commands that we can enter when we are not editing a cell so first i can hit escape if i am editing a cell and i want to deselect it and go into this command mode i can move around with the arrow keys so if i want to make new cells i want three new cells above this one what i can do is actually in command mode i can type the letter a one two three different times i can also go to insert insert cell above and do that manually i'm going to delete that cell though and to do that i can either go to is it edit yeah delete cells not really what i do or i can type the d key twice one two and you probably saw that it went away but these only work if i'm in command mode because if i hit enter and i start editing and i type a well i'm just typing the letter a so if i want to actually create four cells above this one i would hit escape and then i could type a and then to delete them i can do d d double d double d double d so i can insert a cell below using b so a for above b for below these notebooks support a combination of code which is what we've been doing so far with text and text includes things like images and bullet points and headings and all of that we can actually write markdown directly in a notebook but in order to do that we need to make sure we have a markdown cell so this is a code cell right now but i can switch it over to markdown and now if i start typing in here we're not going to see much happen if i run this cell it's now rendering the markdown output for me so that's not very exciting there but if i do a markdown heading heading which is done with a single hash symbol or octathorp now i get that heading if i do you know another heading heading two i can do that i can have a bunch of different levels here's a level five i think i could also add in bullet points hi and goodbye and a whole bunch of other markdown syntax so again this has to be a markdown cell if this was a python cell and i try and run this now i'm going to get an error it doesn't know what to do with this it's trying to run this as python so i can turn it to markdown by actually typing or by clicking mark down like that with my mouse or uh i can use the letter m if i'm in command mode so i'm in command mode right now i type m well it's already a markdown cell but if i want this to be a python cell i don't type the letter c which is confusing i actually type y so y makes this a code cell m makes it markdown we can also restart the kernel or interrupt it and this is important to know about if you do something that's taking forever or is generating some sort of infinite loop or some problem and you're not getting any resolution over here on the client side for example if i have this lovely infinite loop here i'll run this and you'll see it's just going to keep printing numbers over and over and over there's also a little asterisk here indicating that the code is still it's running and we haven't received any result back from the kernel so to interrupt this to stop it i can go kernel interrupt or i can just type ii two times in succession just like to delete a cell we do dd one after another so that interrupted it that stopped it and now i can make my tweak and let's say maybe i meant to do x minus equals one and now if i rerun that cell with command enter or shift enter we get the output i was anticipating so i successfully stopped that infinite loop using that interrupt and then to actually stop this this particular notebook we can do close and halt here so that stops the notebook if i go to this running tab you'll see now that it tells me i have no notebooks running and then if i actually want to shut down jupiter itself there's a server running what i can do is just close the server that was generated for me that's one option in my terminal or i can go to quit and that shuts down the entire jupyter server so if i try and view one of these notebooks now it doesn't know what i'm talking about that localhost that servers is not up and running i would need to relaunch the notebook application alrighty so that's a quick crash course on how to use jupyter notebook uh there's there's more shortcuts and different commands different things in the menus that we could cover but what i covered is the most important stuff that will at least get you started so i hope you enjoyed it if you're interested in learning more about jupyter notebook or you want to learn more about data analysis and visualization with pandas seabourn and matplotlib yep you know it i have a course i just released on it coupon in the description and uh happy new year everyone hope you're doing great i love you i never thought i would say that but i love you i do
Info
Channel: Colt Steele
Views: 39,056
Rating: undefined out of 5
Keywords:
Id: H9Iu49E6Mxs
Channel Id: undefined
Length: 10min 53sec (653 seconds)
Published: Tue Jan 04 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.