 Good morning evening and everything in between what we are doing today is we are sort of rounding up our data science portion of CSE 111 specifically about talking about a sort of library a development environment is really a better way of thinking about it But it's known as Jupiter. So if you think about it, what we've been talking about all of Really how we've been working this entire semester is through spider Spiders a development environment that allows us to code and we see that code Console sort of on the other screen you can do some other crazy things like look at the values of the variables But it's just a development environment. You can code that code exists. It can be ran from anywhere Jupiter creates what are known as interactive notebooks. The entire idea is It's going to take our code and it's going to take those console outputs and sort of Mix them together in a way almost similar to how it works in idle but in a sort of visually pleasing way and you know other ways as well, but It sort of kind of creates this interactive website that we can manipulate So if we kind of take a look we've been again using the anaconda navigator Toolset you've been familiar with spider, right? You click on this launch button you load spider you code and spider But there's tons of different libraries and development environments out there. So say for example our studio pandas is pandas data frames are designed similar to model how our Models data through its data frames. Well, if you're using our guess what you can in my case install it Or you could hit run Same kind of thing we have Jupiter So the entire concept is Jupiter's just going to build a website build a web page for us as we see in one second And there you go now. It's loading in this problem. So Congratulations, you've got Jupiter running whoop-de-doo now what okay? Well, I'm gonna go ahead and jump to the CSE 111 folder that we've been working on for a few weeks now And that's on my desktop and there it is Now same kind of concept. I have say for example my iris data set This is it I can click it and what do you know? It will actually load it up I can edit and manipulate this data as I see fit But specifically I want to create something in say our core folder. That's where we've been working with the Temp file so far So the same kind of thing I would just sort of come in here and our little new options over on the right and Select in our case a Python 3 notebook Again, this is creating its own tiny little library Or sorry tiny little web page and again you can see it's pretty blank to start But now we have interactive what Jupiter likes to call cells and the entire idea is these individual snows or snows Cells are little code snippets that we can use manipulate and reuse So in this case that first one every time I'm working inside of Jupiter I like to treat this as my import statements And the entire idea there is just this is where all the libraries I'm planning on using Come in. This is no different than when you're working off of a Python template So in our case, I want to do say for example a scatter plot analysis of the iris data set We've already done this, but I want to use Jupiter in this case so we can see what happens. So in our case I'll come in and import pandas as PD and import matpawplot lib.pyplot as PLT Okay, fancy, you know, I've written three lines of code Well, again, this is a little tiny snippet and so if I use two fingers and I hold shift enter What it did was that what Jupiter did was it loaded that data into its memory And so suddenly I have access to the pandas library the matplot lib library and I can use them in other Snippets so again say for example, I want to load that iris data set so I'll just call it iris since we're using that equals PD dot read CSV and again since we're using sort of a File hierarchy. I need to go up a directory up a directory Down into the data directory down into the data directory and there's my iris.csv and There's my iris.csv Now I hit that I run it once again. I have that data loaded into a cell So I'm able to manipulate it as I see fit So say for example, I came in and did something like iris or iris.head again Jupiter is going to create this interactive notebook. So as I'm Coding out my work, you know, if I did the dot head function, you know, we've seen that in spider It's gonna little print out over on the console side. I don't really have a console here. So where's it going to appear? It's gonna appear in line. So literally that data has appeared in this case sort of a little snippet of it Jumping down so my cell executed and wherever that output would go Jupiter what does is output so in this case you can see I can double-click and hide that or you know Whatever the entire point is now it's Loading that data in line So I'm gonna do just one more step and then we're going to see a way to say plot our data Using Jupiter so in this case the first thing I'm going to do is just specify which features I want to work off of inside of my Jupiter library and This is actually one of the beautiful things just on accident. You know just force to have it I already hit shift enter, right? I accidentally Shift entered and so that line of code is executed. Oh Well, I guess that's it. No, so What I can do is I can actually go into these cells as you can see my cursor is blinking here and I can go in and continue to manipulate them Even though I've already executed that part. So in this case, I can come in and create the y-axis Now what's gonna happen when I hit shift enter? It's going to take whatever that snippet of code is and Rerun it so effectively those two lines. It was just one line. It was just x-axis getting created now x-axis is once again created or updated and y-axis now exists Pretty nice so the last little bit is once again, I want to sort of create some scatter plot diagrams of Say the Seeple length and the petal width. Okay. Well in that case We're just doing a lot of these similar approaches that we've seen with pandas in the past. So in my case, I'm going to Just go ahead and take my iris data set and group by its species So again, and I'll hold off on it. So again, that's just going to extract out where there are the same values So all of my Satosas are gonna be in one group All of my various of colors in one group and my virginica's in one group Then I can use something like a for loop. So in our case for name comma data in species remember name is going to be effectively what was the sort of thing that was unique or Was common amongst all of the elements in a particular group So all of them were Satosas and then all of them were virginica's and various colors That's what names going to be data is literally going to be a small micro data frame of That data. So in our case, that's what I want to plot. So in our case plt.scatter Let's see. We're going to go with data at the x-axis Across data at the y-axis now the last little thing I'm going to add in here is name equals or sorry label Equals name The entire reason here is because what if I want to create save for example a legend I want to plot out my data and I want to Effectively show which of the different species is which color since I'm using a for loop One of the things that pandas is going to be doing in the background or map plot lib Is going to be doing in the background is it's going to be assigning it a different color So in our case as I hit shift enter you can see to start. Oh, look at that It's going to plot that data in line with the rest of my code now Like I said, I wanted to have a legend. I accidentally clicked the shift enter too soon Well in that case I can just come back up here plt.legend legend and as you can guess it just like when I did my dot head I could manipulate that and Just to show that off again. I can manipulate this it will change what the output is for a Particular so the same thing is going to happen here when I hit shift enter You can already probably guess what's going to happen this time. It's going to have a nice little legend as well And so all we're really doing is sort of creating these interactive pages I keep using that term, but it's really effectively just letting us code and then as we Want to make print statements or see what our data is doing. It just allows it to happen in flow Sort of in that just kind of linear fashion that vertical structure that we're working off of and so that's how you use Jupiter