Hello, everyone, and welcome to this tutorial here in this tutorial, we will understand the frames.
Let us begin.
Our data frame is a two dimensional Radosta Judd that these data is aligned in a tabular fashion in
drawers and columns depend as data frame consists of three principal components, data, rows and columns
to understand data frames.
First, we have to import, but it needs.
Important MP as MP, then import Ben Dodds as PD after that import.
One more liability from num dort random
import brand and.
Then import and PDR, random dot seed one zero one.
Great.
You will ensure that we will house same output.
Now define a data frame the F to define data frame.
We have to use a method BD dot data frame.
And these are the arguments that we can enter here.
Data.
Index columns.
Data type.
And copy specified data.
First data is equal to land.
And for you.
Comma food.
Didn't specify the index.
A, b.
C, b, e.
After that specified the columns.
W x.
Vij.
Z execute.
No, Jake, this did help him the F.
Great.
So this is our data frame.
So these are the column names W, X, Y, Z.
And these are the names.
A, B, C, D, E.
And this is the data, as we have discussed earlier.
This data in a table, lot of farm rows and columns.
Each of these column is a number ECD.
This is a number ECD column W.
This is a number.
Series.
Again, column X.
Column Y and column.
The each of these column is a number C reads.
And all these numbers series share a common index.
This one.
So we can say that data stream is a bunch of bendat TV that share a common index.
So these are the basics about the data frame.
And this is how we can create a data stream using this method dot data frame.
Let us understand indexing and selection.
Suppose we want to select this column.
Column W to do that by the name of data frame and then specify the column name.
So this is a very quiet output column w no, take the tape.
D.F..
Column DeBlois.
Series.
So this column is a name P.c reads.
No, Jake, the type of data frame B F.
They delphinium.
So they doorframe is a bunch of numpty series with common index from the day doorframes, if we can
select multiple columns.
Also, let us see how.
Take the data from the F.
He we will select these two columns X and VI.
To do that type name off the data frame here, we will passing at least Golomb X and column by execute.
Great.
So this is our output column X and column by no Kopit is.
Take the tape.
They Dufrene when there is more than one Numpty series, then it is a data frame.
So this is all about the indexing and selection in data frames.
Let us understand how to add a new column.
First, take the data from the EFF so we can add a column.
To add a column, type B F specified the name of new, column new, we will add this column with arithmetic.
Operation B, F, column W, Blur's B F.
Column X.
Execute.
Now, Jake, D-Day Delphinium, B.F..
Great.
So this column is added successfully here.
And this is the addition of these two columns, column W and column X.
So this is how we can add a new column in data frame.
Let us understand how to remove the columns and drawers in data frames.
Removing columns and roads.
To remove a column, we use drop method type D.F. dot drop.
Here we have to specify labels and axes.
Specify labels first.
Labels is equal to new.
This is the name of a column that we are going to remove.
Then specify axes.
Axes is equal to one axis, is equal to one for the columns and axis is equal to zero for the rules.
No execute.
Great.
So the column new is removed here.
Now take the detailed from the F.
In regional data frame, this column is not removed to remove this column permanently be how to add
one more parameter IBF dot drop.
Specify labels new, then specify axes vun to delete this column permanently, be able to specify in
place is equal to true.
In place is equal to true.
No execute.
Dig the data frame.
Great.
So this column is removed successfully to remove a column V, how to deliberately specify in place is
equal to true.
So this is how we can remove a column from a data frame.
Let us understand how to remove a rule a b f dot draw.
Specify a name of the rule.
B.
And after that we have to specify the index.
Access is equal to zero.
Execute.
You can see here Ruby is deleted.
No, no, down here.
By default, access is equal to zero.
So we don't have to specify this.
It will take automatically.
So this is all about deleting rows and columns in a data frame.
Let us understand how to select the rules in a data stream.
Selecting deludes.
For Dick debate to frame the F.
Great.
Now, suppose we want to select this through this one.
See, to do that type data frame the F Dot LLC.
And specify the name of Duru executed.
So this is the road that we have selected rules.
Now take the data type.
COPD.
Based.
Seaweed's, so data frame is also a number ECD.
So this is Helvey again, select deals in a data frame.
Let us understand how to select the subset of rules and columns.
Selecting this subset of rules and columns.
Dig, dig, dig it out from the F.
Great.
No, suppose they want to select this value zero point seven fold to do that type data frame.
B f.
Got a Locy here.
We have to specify Drew and column.
So this value has rule.
See, and column X specify a row first, then the column execute.
So this is a very wide output.
We can select a subset.
Also, let us see how.
We will select these four values.
Minus zero point nine three zero point nine for you.
Two point six zero and zero point six eight.
By the F dot Alosi.
First, we have to specify do lose.
So these four values has rules B and E specify as a list the.
Then V, how to specify column names.
VI and the VI commands the executed.
So this is a very quiet output.
First, we have to specify the rules and then we have to specify the columns.
When we have to select multiple rows and multiple columns, then we have to specify rules as a list.
And columns also as a list.
So in this little deal, we have learned a lot of things.
Literary vides.
First, the Hill understood how to create a data frame to create a data stream.
We use this method data frame.
After that, we felt understood indexing and selection in a data frame, a single column in a data frame
is another piece.
Deeds and data frame is a bunch of numbers, c.D, with a common index.
After that, we helped understood how to add a new column in a data frame.
So this way we can add a new column in a data frame.
Then we all understood how to remove columns and rules for the columns to be able to specify.
Access is equal to one and for Duros we have to specify access is equal to zero.
And to say this change button one and only be able to specify in place is equal to true.
After that, we have understood how to select the rules like these to select the rules.
We have to use this method.
Dot Alosi.
And at the end, we understood how to select a subset of rules and columns.
So this first by 10, did all deal on data frames.
I will see you in the next one.
buildOn, happy learning.