Hello and welcome back to another class of our course about the complete introduction to the science
with Python.
So in this class, we are going to start working with Seabourne and we are going to create our first
graph with this amazing, too.
So he's going to first grab that.
We are going to be of this blood, which consists of a histogram that is directly inside the well,
which consists of a line that is directly inside of the histogram.
So basically, you'll see it's pretty cool.
So what exactly will do?
It's pretty simple.
We will, first of all, import a database or a dataset directly from the Internet, more precisely
from GitHub.
And we are going to work with those databases.
For those of you who don't know where from where exactly, we'll import Irda will imported from here.
So we see as you can see, this is GitHub and this is all the databases that you guys have.
So basically there are plenty of those databases.
So I'm going to show you how to import any of those databases.
And we are going to work with the most simple ones.
In this case, the most simple ones would be flight and in my opinion, tips.
So basically, those are the two databases that are not really complicated and really interesting to
work with.
All right.
So let's come back to our pie chart.
So basically, the first thing to do would be to import everything right here.
So everything has been imported.
One less thing.
Yes.
So importing all the things that we need so we have no pipeline does matter.
And finally, Seabourne, very important matplotlib not forget to write down that pipeline, because
even if you don't write it down, you will not be able to work with all that blood.
All right.
So the first thing that will do is pretty simple is importing our databases.
So we need to create a viable that we will call in our case database.
So basically, I'm calling it database.
You can call it whatever you want.
So we'll create a variable that will be called database.
All right.
So when it's all done, the next thing that we'll do, we will use a function that will be referred
to Seabourne.
So we'll start what we will write with S.B.
So we are making a reference to Seabourne in this case and we are going to ask Seabourne to load a dataset.
So basically that data set in this case, we decide what data said that we want.
So let's say we want to import diamonds.
So this is one of the data sets that we have.
So just to be sure, we can come back here.
So we have a dataset that is called diamonds or diamonds.
So this is exactly what we'll do right now.
We'll import this data set.
And just to be sure that everything works fine.
What we'll do will printed.
So to be able to see what it looks like.
So we will print database, which is our this is our variable right here.
So let's print it and see what it looks like.
All right, so as you can see, everything works fine, so we have printed our database, our database
works.
So here we go.
We have our Dimond's database.
So this database is pretty huge.
It's consisted of fifty three thousand nine hundred forty rows and ten columns.
So this is a pretty big database.
And the next thing that we want to do right now is pretty simple.
We want to create our block or our graph.
So for those of you who didn't understand what I just did, I imported the database.
So here you have Dimond's, but you can change it by any other database that you want from this website
right there.
So pretty simple if you want to change it for dots, you can change it for dots.
If you want to change it for you can change it for empty.
And what it will do, it will simply import other databases so you can create your plots with any database
that you guys want.
All right.
So for the next the next step, what we'll do, we will work with one of those variables right here.
So I'm proposing to work with that.
Carrots where price.
So let's work with Chariot's.
So what we'll do right now, we are going to create our blood.
So once again, we are going to make a reference to Seabourne.
So it's going to be S.B.
And the type of blood that we are going to create will be the this plot.
So basically we have this plot so that this plot will be referred to database.
So basically we are going to take all our so we are going to take our information from database and
then from what variable?
From the Bible in this case, Charite.
So we are referring everything to data base, so to the variable database and from the database.
We want Python to look for Charite inside of this of this database right here.
All right.
So we will write down Carrott.
So basically it will use those numbers that are right here to create the plot or the graph.
All right.
Next thing that we want to do is simply show everything to see what it looks like.
So it's going to be PLT that show we can open up and close the parenthesis that we have.
So this formula, will this function right here is just to show everything, this function right here,
what it means, it's pretty simple.
We are using dereference SB to be able to work with this blood function that is referred to Seabourne.
And basically what this function does, it will ask database.
So it will have a reference to database.
So we are going to go to database and from database we want to extract the element.
Charite.
So basically in the database we have diamonds and from diamonds we we want to extract.
Basically, when it's all done, you guys can run everything.
So you'll have your database and finally you will have your plot right here.
So you can see something that is pretty simple.
You have your histogram and basically you have the line inside of the histogram.
Once again, this is a bit complicated to understand, since it's well, we we are working with carats,
but this is exactly what it will be generated.
So this is what we will generate with our well, with this type of.
So, yes, of course, sometimes we can have graphs that are specialized in some things, maybe this
graph is not the best graph for for it to, you know, carrots, for example.
Once again, this is a good way to show you guys what type of graph that you can generate.
Next thing that you can do, you can add beans.
Beans will simply add well, will simply tell you what is how big you want your histogram to be.
So basically, it could be one.
It could be two.
It could be three.
You could before.
So you decide you will simply add it here.
So basically inside of it you can add your beans.
So if you simply write down beans and you write down the well how big you want your beans to be.
So it's going to be just sheer.
So we want to load this database and here we go, we want to have our bins and we decide how big one
of them should be in this case, let's say we want to have bins of one.
So this is how big we want our histogram to be and we can run everything.
So here we go.
As you can see, the bin size have changed and the histogram has changed.
Once again, this is this is not a perfect example to do it with the carrots, for example, because
once again, it doesn't give a grab.
That makes a lot of sense.
But once again, as you can see, this is how it works.
So we see the bins is simply how big you want your histogram to be.
So this is what you guys need to understand.
So really important.
You need to write it down right here was a bit lost earlier.
So you write it down right there.
So database and after the element that you guys want to extract from your database.
So you write down your kids.
All right.
So I hope you guys right now understand what exactly you need to do to be able to create your this blog.
So basically, your histogram with a line inside of it.
And I hope you guys understand.
Well, you can use it in any other way that you want.
So if we want to simply do a little bit another thing that is pretty cool, so basically simply change
databases so we can, for example, work with dots in this case.
So let's choose dots and we run everything.
So we'll simply take this away.
So here we go.
It's going to generate dots right here.
So those are the dots.
And what we can do right now, we can, for example, extract something else.
So, for example, we want to extract the decoherence from our dots.
We can do it so we can simply copy everything and pass it right here.
So we want to extract clearance from the database dots.
And if we run, everything, as you can see, will receive our chart right here.
So basically, this would be our histogram inside.
Well, this would be our histogram that will be generated.
So you can see you can work with any database that you guys want from this website.
So that's it, first class guys and see our next class.