Hello and welcome back to another class of our course was the complete introduction to the science with
Python.
So we going to discuss we are still going to talk about some pendas operation.
And the main operation that we are going to talk about today will be joining operation.
So basically, what does this mean?
It's pretty simple.
So I'd say you guys have two databases and you want to join them together.
So putting those two databases together to do this, you will be using the joint function and you'll
see it's not really hard to do and it can make really good results.
All right.
So before we start, what we'll do is pretty simple.
We'll import that Pendas extension.
All right, so when this is done, what we'll do right now, we'll create our two databases, so basically
the list that will be used inside of our database, so we'll work with the exact same thing.
So we will work with foods and it's going to be really simple.
So the first list will be called Food One.
So will have our food one and basically will have the number, the name of the food and the price of
the food.
So basically the same thing that we used in the past that we did so basically for the number of the
food will have numbers from one to five.
So we will have.
No, two points, so from one to five.
Then we'll have the name of our foods.
Would go so for the names like always, we'll have apple, banana chips, popcorn and pizza.
So pretty simple.
So chips, popcorn, and finally, pizza.
All right.
And finally, the last thing that we will have will be the price of our foods.
So, as always, here, we'll have our price.
All right, so here will enter the prices, so let's say it's going to be some random numbers.
So let's say two, six, four, three, five.
Here we go.
So we have our prices.
So we have our numbers.
We have our names.
We have our foods.
We have our prices.
All right.
So this would be for the first part and then we'll create our second list for our second database for
dereference I will call it food to end inside of this list.
We will have some other variables.
So here will enter colors, waits and finally quantities.
So let's say colors will be in this case, to call it color.
So for Apple, it's going to be red for banana.
It's going to be yellow for chips.
It's going to be orange.
For popcorn, it's got to be white and for pizza, it's going to be, let's say, blue, because we're
having a blue pizza.
And finally, the last thing that we are going to use, well, we have two other two other things.
Sorry.
So we'll have the wait so the wait in let's say, I don't know, gram.
So wait.
Let's say for the wait, it's going to be in this case.
Here we go.
All right, then, for the week, we'll have, let's say, one hundred grams to 100 grams, 150.
One, seven, five, and finally, two hundred twenty five Grayton.
Finally, the last thing that we are going to have will be the quantity.
Here we go, and we can enter it right here, so it's great for the quantity, let's say it's going
to be one, two, one, three, four, right.
So we have everything that we need to have that our list for the food on our list for the next thing
that we want to do is really create our data frame.
So basically we create the formula to create our Daraprim.
Just a quick parenthesis, it's possible to write down a line of code that will automatically create
ditherer frame and at the same time enter all this list of things that we will use inside of a data
frame.
But once again, since we are, I assume that you guys are doing this for the first time.
I'm going in two steps.
So basically we are entering everything right here and then we are creating that frame.
So we will have table one in this case.
And as always, we'll use the Penders extension Daraprim and will enter Food One, we'll do the exact
same thing for food to.
Here we go, so we have our table then want to do the exact same thing for the food.
Number two, as I said, so here we start using our pendas extensions, then what we'll do with fusion
everything together.
So as like in the best glass, we use the fuel.
The fusion variable will do the exact same thing, will give will give us the exact same name.
So it's going to be fusion.
But in this case we will work with the joint function.
So what how exactly does this work?
So basically we'll use the table number one.
So it's going to be table number one dot and then we'll write down our joint functions with the joint.
We want to join table number one with table number two.
So in this case, we have our table number one right here that we just created that will use the data
frame of all the elements inside of the list right here.
And we want to join the stable one with the table, two that have been created right here that will
use all the elements of the list right here.
So when everything is done, we want to do is simply print our fusion Vattel.
So we simply print fusion.
Here we go.
So when everything is done, we can simply run app and as you can see, we will have our two data frames
right here mixed together.
So basically, as you can see, we will have no one.
It's going to be Apple.
The price of the apple will be two dollars.
The color of the apple is red, the weight is one hundred grams, and finally the quantity will be one.
So what have we done?
It's pretty simple.
We simply joined or put it together the delete the list right here or the database that is content right
here that that works with the list right here and the data frame or the database that is right here.
And that works through the list right here that you can see.
It's pretty simple to do and it can be a really effective operation.
We can do.
Well, there are plenty of things that you guys can do with it, but those are just the basics of what
you can do with a joint operation.
So that's it.
First glance, guys, and see all our next class.