Hi.
This video we will learn what this data frame index and multi-index
when we check our data frame, uh, with the head method. Uh,
this bold number on the row axis is the default index and it is
basically range index.
It can be converted to the list, uh, with a tool list method,
and uh, basically an index is, uh, a row identifier,
but its labels doesn't have to be unique. In contrary to column name,
we can set another column as index, for example here, uh,
we set the protocol column as, uh, index,
and we can do this with the set index method.
Now, uh, we see that, uh,
the index is now an unordered categorical index.
Now it is very easy to filter roles according to this index.
We just specified the name of the protocols we would like to see,
uh, there are other options to filter the data,
but we have a separate video for this.
Another thing, but we can do with the index. We can rest the data, uh,
back to the index, uh, with the reset index method.
Now,
column names are the labels which identify each column.
They must be unique, but when we refer to data frame columns, we can get,
uh, an index can of type object. As you can see here
now, to multi-index. Index and columns, uh,
may have multiple levels. Uh, and, uh,
let's do an example here. I created a summary data frame,
which tells us, uh, what are the counts,
average and median of the time variable and minimum
and maximum of the destination port grouped by attack,
category and protocol.
Do not worry about this too much for now. Uh,
for this we have a separate video on how to summarize the data.
This is just to showcase you the multi-index. This
is how it look like. Uh, we VC for example,
that, uh,
all the fathers attack via T C P protocol took,
uh,
60 seconds on average and there were only 127 of them.
And now when we refer to the data frame index, uh,
we see we have a malting this object. The same applies to the columns.
In our next video,
we will learn how to do the most common operations on data frame,
like filtering and so on.