WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.700 --> 00:00:08.390
Hi.

1
00:00:08.390 --> 00:00:12.760
This video we will learn what this data frame index and multi-index

2
00:00:15.890 --> 00:00:19.970
when we check our data frame, uh, with the head method. Uh,

3
00:00:19.970 --> 00:00:24.690
this bold number on the row axis is the default index and it is

4
00:00:24.690 --> 00:00:26.990
basically range index.

5
00:00:27.970 --> 00:00:31.550
It can be converted to the list, uh, with a tool list method,

6
00:00:32.790 --> 00:00:37.170
and uh, basically an index is, uh, a row identifier,

7
00:00:37.430 --> 00:00:41.250
but its labels doesn't have to be unique. In contrary to column name,

8
00:00:44.950 --> 00:00:49.290
we can set another column as index, for example here, uh,

9
00:00:49.390 --> 00:00:52.010
we set the protocol column as, uh, index,

10
00:00:52.790 --> 00:00:54.930
and we can do this with the set index method.

11
00:01:00.600 --> 00:01:02.980
Now, uh, we see that, uh,

12
00:01:03.880 --> 00:01:07.380
the index is now an unordered categorical index.

13
00:01:08.290 --> 00:01:12.390
Now it is very easy to filter roles according to this index.

14
00:01:12.770 --> 00:01:16.630
We just specified the name of the protocols we would like to see,

15
00:01:18.100 --> 00:01:20.240
uh, there are other options to filter the data,

16
00:01:20.460 --> 00:01:22.720
but we have a separate video for this.

17
00:01:33.840 --> 00:01:38.410
Another thing, but we can do with the index. We can rest the data, uh,

18
00:01:38.720 --> 00:01:42.170
back to the index, uh, with the reset index method.

19
00:01:57.300 --> 00:01:58.133
Now,

20
00:01:58.490 --> 00:02:02.430
column names are the labels which identify each column.

21
00:02:02.540 --> 00:02:07.510
They must be unique, but when we refer to data frame columns, we can get,

22
00:02:07.610 --> 00:02:11.830
uh, an index can of type object. As you can see here

23
00:02:15.430 --> 00:02:19.470
now, to multi-index. Index and columns, uh,

24
00:02:19.530 --> 00:02:22.070
may have multiple levels. Uh, and, uh,

25
00:02:22.200 --> 00:02:26.840
let's do an example here. I created a summary data frame,

26
00:02:27.130 --> 00:02:30.000
which tells us, uh, what are the counts,

27
00:02:30.000 --> 00:02:34.790
average and median of the time variable and minimum

28
00:02:34.850 --> 00:02:38.870
and maximum of the destination port grouped by attack,

29
00:02:39.070 --> 00:02:40.190
category and protocol.

30
00:02:41.940 --> 00:02:44.640
Do not worry about this too much for now. Uh,

31
00:02:44.780 --> 00:02:48.000
for this we have a separate video on how to summarize the data.

32
00:02:49.690 --> 00:02:52.580
This is just to showcase you the multi-index. This

33
00:02:54.240 --> 00:02:58.950
is how it look like. Uh, we VC for example,

34
00:02:59.950 --> 00:03:00.783
that, uh,

35
00:03:01.960 --> 00:03:06.850
all the fathers attack via T C P protocol took,

36
00:03:07.030 --> 00:03:07.863
uh,

37
00:03:08.560 --> 00:03:12.990
60 seconds on average and there were only 127 of them.

38
00:03:16.960 --> 00:03:20.340
And now when we refer to the data frame index, uh,

39
00:03:20.480 --> 00:03:25.440
we see we have a malting this object. The same applies to the columns.

40
00:03:28.760 --> 00:03:29.660
In our next video,

41
00:03:30.080 --> 00:03:33.780
we will learn how to do the most common operations on data frame,

42
00:03:33.810 --> 00:03:35.180
like filtering and so on.
