Hello and welcome to this tutorial here, we will understand merging, joining and concatenating the
data frames.
Let us begin.
First, import reliability.
Great.
--.
We will understand data frames, concatenation, the concatenation, glue's data frames together.
To understand the data frame concatenation first, to be able to define three data streams.
B.
F one.
B, F two.
And the F three.
Execute.
Great.
No, take these three data frames.
B, f one.
Then D.F. to.
And the EF three.
So these are the three data frames in these three data frames.
There are four rows and four columns.
You can see column names are A, B, C, D, same here.
And same in data frame three.
But the indexes are different in first data frame zero, two, three, then four, five, six, seven.
And after that, eight, nine, ten, eleven.
Let us do concatenation.
PD dot concat.
So these are the parameters that we can enter here.
We will enter only one parameter.
This one.
Type objects enter the data frames, the F one, B, F two and B F three.
And by default, access is equal to zero.
No execute.
Great.
So this is our output.
We have successfully concatenated all these three data streams from zero to three.
B, F one, then B, F two.
And at the end, B, F three.
Here we have concatenated all these data frames along.
The axis is equal to zero.
Let us do concatenation along the axis is equal to one, the dot concat.
Specified barometer OBD as.
Data from one, data from two and data from three.
Then specify access is equal to one execute.
Now this is the output.
Let us understand here.
V.L. applied concatenation along the axis is equal to one.
This is data frame one.
This is data frame two.
And this is data stream three.
In simple words, we can say that access is equal to zero means along the road and access is equal to
one means along the columns here.
First four columns for D.F. one, then second four columns for the F two and last four columns for the
F3.
And all other values are none to your.
While applying access is equal to zero or access is equal to one.
We help to take our information first.
Otherwise, the output will be like this, many nail values in the output.
So this is all about the data frames, concatenation.
Let us understand.
Data frames margin.
He had also v, how to define these two data frames.
B, A, Ford and DFI U.
Execute.
Now, take these two data frames, B F for.
And D.F., you.
So these are the two data frames, the Ford.
And DFI you in these two data frames, there are three columns and Ford rows.
These are the columns, key A and B here, also same key C.
And these are the indexes.
Zero two three zero two three.
To merge these two data frames, IPD dot merge.
He added, We will specify three parameters left, right.
And this one on the left is equal to.
D.F. Ford.
And right is equal to.
B F for you.
And we're merging these two data frames on.
Gholam Key.
Execute.
Great.
So this is the output column A and B from data from the F Food and column C and D from the F for you.
And this is the common column G on the basis of column key.
We merged these two data frames.
Let us see one more example.
Defined to date, DuFresne's, B, F six and B, F seven.
Great.
No, take these two data frames.
The F7.
Great.
No mud.
B, b dot.
Marge.
Interdependency does.
Left is equal to be EF six.
And right is equal to.
B f7 on.
Key vun and key to.
So this is the output column A and B from the F six, column C and D from the F seven.
And these two are the common columns given and keep two.
So this is all about demerging data frames.
Let us understand.
Joining the data frames.
Define to date doorframes.
B.
F eight and B, F nine.
Now, take these two data frames.
Great.
So there are two columns and Ford rules.
Same here.
Two columns and four rows.
Draining the data frames is a convenient method for combining the columns of different data frames into
single one to join these two data streams.
They first data frame B F eight dot join and in parentheses, specify second data.
Frame the F nine.
Great.
So this is the output.
This is the data from the F eight first two columns.
A and B, and after that we joined the F nine.
These two columns.
Column C and column D..
And this is the index for these two data frames, common index.
Let us revise what we had learned in this tutorial.
Merging, dining and concatenating, the data frames first well understood, concatenation of data frames.
After that, we help understood data frames emerging.
And at the end, we all understood joining the data frames.
So this biting ordeal ends here.
I will see you in the next one, buildOn.
Happy learning.