Helgason, welcome back to another class of our course about the complete introduction to data science.
So in today's class, we are going to learn how to use.
So basically, we're going to learn how to create tables inside of pendas with the use of Python codes
as well as Banda's operations.
So it's pretty simple.
Let me just explain you what I mean by table.
So let me just open up this little Excel folder.
So basically what I mean by tables is just creating your first little database inside of Python.
So basically, you guys will recreate this little database inside of Python.
So I created something that is pretty simple.
So we have numbers.
We have the names of employees associated with their numbers and finally we have their hourly salary
or how much they earn per hour.
So let's say you guys have all this on Excel and now you want to put all this on Python.
So how will it work?
So it's pretty simple.
The first thing that you guys will need to do is open up your app by Tromso right here and import Banda's
Aspley.
So import it could be speedier as anything you want.
So basically we import Banda's does the first thing because we want to use some up models or expand
operations inside of our well when we will create our database.
All right.
Next thing that we want to do is give a name to our database.
So basically it's going to be employee and inside of employee.
We are going to store all the data that is going to be used to create our table or our database.
All right.
So we will start the creation.
So right now, the first thing that we'll do will open up parenthesis like this.
And the first thing is we want to enter all the numbers.
So basically, you open up you right down to like this and you write down number from this moment to
points and you enter all the numbers that you have.
So what are the numbers that we have?
We have one, two, three, four, as well as five.
We do the exact same thing for names.
So basically two commas like this.
We write the name and then we enter all the names that we have.
So basically, in this case, what are the names that we have?
We have A, B, John, Mark and Bob.
But basically those are all the names that we have.
So here we go.
So we have Amy, John Lennon, Mark and Bob, and that basically you guys can write down as many rules
as you want.
So each thing like this is one route and this is all the elements that are part of the rules.
So basically, we have numbers one, two, three, four, five.
We have names and then we will have hourly salary.
If you guys want to add some other things, for example, where they live, where they work and any
other thing, it could work as well.
All right.
So the last thing, as I said, will be the hourly salary.
So in this case, write it down.
So hourly salary.
Then you write down your two points, as always, so it's going to be 15, twenty five, thirty to twenty
seven as well as 40.
All right.
So right now we have everything that we need.
Very important to check for errors if we didn't make no errors.
So as we can see, everything is pretty good.
Next thing I want to do is print everything and look what it looks like.
So you will see it's not going to be as pretty as you think.
So basically it will print employee.
So it's all going to be in a form offline.
So as you can see, it looks something like this.
So it's definitely not like a table, like a table right here like table that is right here.
So what I do right now is we want to use a want to use pendas to be able to generate something there
that is more nice to see.
All right.
So what exactly will do right now?
So we will put everything, everything that is right here inside of a table or inside of a data database.
So you can you will need to give a name to this database or to this table.
So let's call it table one.
So in this case, it's going to be table one and table one will be equal to.
So first thing we will write down because we are going to refer to PD operations.
So it's going to be PD dot data.
So we are going to create a data frame and we want this data frame where we want this data frame to
go find data.
So we want the data from finding its data inside of employees.
So this is all the data that we have created.
So this is all the data of our database and we want to create a data frame with this database.
And the name of this data frame will be table one.
All right.
So what will you write down inside of our data frame will simply be employed.
All right.
So if we run our app again, we're going to receive the exact same thing because we are still running
the employee.
The employee data, so basically what you'll receive will receive screwed that up like this, but if
we want to receive our table, so basically we will need to run our table one and in this case will
receive our data from our database and a more nice way.
So basically, we have it right here.
So no one will be able number two will be done.
Number three will be llena.
Number four will be Mark.
And number five will be Bubp.
So you can see we have our five employees in a form of data from or, well, a database that is, well,
more well, better presented.
So right now, guys, you should be able to create your own database by using pandas and python combined
together.
So that's it for this.
Guys, guys.
And see all in our next class where we are going to learn some other basic pandas operations.