Welcome back to our class of our course about the complete introduction to data science with Python.
So in this class, we are still going to talk about Seabourne and this would be our last class about
this amazing to show up until now.
You understood that this is a really great visualization tool.
All right.
So what we are going to learn today is pretty simple.
We are going to learn to work with multiple plots or multiple graphs.
So basically we are going to work with more than one group.
This is what it means.
So to be able to understand better what type of analysis you guys can do.
I decided to use a another data set of from our well, from our databases.
So we'll use the TIPS database.
So first thing that we are going to do, we are going to we are going to import everything.
So pretty simple.
We are going to create a variable will be called data base.
And as always, we are going to import our dataset.
So load dataset.
And what exactly what the rebels want to import is that this database, so you have everything right
here so we can run the well to print everything first.
All right, here we go.
All right, so we can run everything right now to see if everything works, so as you can see, the
database is generated.
So we have everything right here.
This means that everything works just fine.
All right.
Next thing we want to do right now is creating our data, well, our databases, our two graph search.
So the first thing that we'll do is we are going to create another variable.
This one, let's call it Gref, because we are creating a graph.
And here we want to do right now, we want to use another function that is called face grid.
So once again, this is a seabourne function.
So we are going to start with S.B, that faced grid.
So pretty important.
The effort has to be in capital letters because if it's not, it's not going to work.
All right.
Next thing that we need to write down, the first argument actually will be from where we are going
to take our data.
So we are going to take our data from the variable database.
So this is what we'll write down.
So database right here, then what will be our columns?
So our call in this case, we want to know if the person's a male or a female.
So inside of our columns, we will have the sex of the person.
And finally, the hue, which in our case will be if the person is a smoker or no.
So this is what we are looking for.
All right.
Next thing that we are going to use is another function, which is map.
So basically we will we want to create two graphs.
So basically we are going to use the map function.
So once again, graph that map.
So basically the graph variables and right now what type of graphs that we want or what type of blood
that we want.
Pretty simple.
We want scatter plots because in my opinion, this is the most representative of the well, the situation
that we are trying to study.
All right.
So right now, next thing that we want is what we want inside of our scatterplot.
So we want the total bill.
And that.
So right now, we have everything that we need suggesting that think will do simply show.
So we need to show everything.
So you see the graph, so guilty dot show and then pretty simple, we just run everything.
All right.
So right now we receive this type of graph.
So basically, what can we understand if we want to make a quick analysis of this graph is pretty simple.
So this is this graph is for males.
So basically all those right here are guys and all the persons right here are girls.
So basically, we can see how many smokers.
So we have smokers and non smokers.
So basically the younger ones are smokers and the blue ones are no smokers have left a tip based on
the total bill.
So basically, we are studying right now for variables.
We are able to study basically four variables just with one graph.
So basically, depending on the color, we are able to know how much the person have left.
And we can also know, for example, if a smoker left more than a non smoker.
And in this case, we can see that there is no correlation between smokers and non smokers.
So basically, if a smoker left is more than a non smoker, so we can see the left pretty much the same
thing.
But what we can see in this graph, we can easily see that men's leave more tips, like, for example,
in their extremes, leave more tips than woman.
So, for example, based.
So once again, based on the graph right here, and if we look at the average, it's pretty much the
same thing.
So men live leave more than women based on the data right here once again.
So the extremes are more higher for men.
This is what we see.
So once again, this is what we can conclude with the analysis right here.
So basically, as you can see, we are able to make an analysis with four variables.
So we have the total bill, we have the tip.
We have the sex of the person if the person is a male or a female.
And finally, if the person is a smoker or a nonsmoker, you can see we can make a complete analysis
with the database that we have right here so we can take a simple database that is right here and create
something really advanced and really have really interesting data about, well, actually all the population
that have ate at that restaurant.
So you can see there there is plenty of really interesting things that you guys can do with Seabourne.
So what I showed you right now are just the basics.
Basically, we have learned how to create some plots or some graphs and the basics of analyzing those
graphs.
That's right.
Now, if you guys want to learn a little bit more, you can import your own databases.
So basically from simply write them as big data sets and you can import your own datasets and try to
study them to understand a little bit more of the concept about, well, all the data science that is
around those databases.
There is a lot of really interesting things to learn.
Besides of that, I hope you guys understood the power of Seabourne and how it could be really powerful
in analyzing data.
So this is really an amazing we analyze data and the sense it works with matplotlib, you know, that
it's really high quality data visualization that you guys will have.
So that's it for this seabourne part of this diskless.
And see you on the C o on my other class as well, on the other class, where we are going to talk about
some other topics about data science.