WEBVTT 00:00.640 --> 00:03.000 Now let's get back to work from this lecture. 00:03.020 --> 00:05.060 We're talking about manipulation. 00:05.210 --> 00:11.930 How to delete a column or maybe adding new column maybe adding new rules modifying some values or maybe 00:11.930 --> 00:13.900 about indexing and slicing. 00:13.940 --> 00:16.550 So we're doing all this stuff from this lecture. 00:16.910 --> 00:22.700 So the first thing that I want to talk about is remember this one is the column or the header and this 00:22.700 --> 00:25.540 one is the raw or we call as index. 00:25.610 --> 00:33.410 So if I talk about first index of visitor that is 700 and if I talk about first and second index of 00:33.410 --> 00:41.640 visitor that is 700 and 900 if I talk about first column and then our first row then it means seven 00:41.640 --> 00:42.680 and eight. 00:42.740 --> 00:47.960 If I talk about first column and first and second row that means seven hundred and nine hundred. 00:47.990 --> 00:50.090 So these are actually labels. 00:50.090 --> 00:56.650 So whenever we try to slice something or whenever we try to nick something we use label based indexing. 00:57.050 --> 01:00.810 So that means I would be using their names particular names. 01:00.950 --> 01:09.170 I can say like data office da bomb Street and country or I can use position like 0 1 2 3. 01:09.230 --> 01:11.640 So something like that I need to follow. 01:11.660 --> 01:17.150 So there are two approaches for slicing and indexing the first one is liberal based and the second one 01:17.150 --> 01:18.560 is position based. 01:18.590 --> 01:19.910 So let's get started. 01:20.420 --> 01:26.760 So let us take our first task or I have to do is I have to take a slice or I have to take us in next 01:27.140 --> 01:36.440 from second to fifth and I need only country and clicks so hard that I would be using my data frame 01:36.740 --> 01:44.090 and then I need to use loc that is a low C and then with a square bracket I need to pass through I mean 01:44.090 --> 01:44.590 does. 01:45.350 --> 01:47.360 So I need to pass the label names. 01:47.360 --> 01:53.770 That is if I'm taking it Next I need to pass the label names and if I'm taking columns I need to pass 01:53.770 --> 01:55.240 daily with names. 01:55.310 --> 02:01.290 So suppose I need intersection from two to fifth and country two clicks. 02:01.370 --> 02:08.030 So I would be passing the first value has to do first and then comma and then you need in the section 02:08.030 --> 02:10.850 from country to clicks. 02:10.850 --> 02:17.050 Let me take this example and execute this one. 02:17.260 --> 02:20.940 You see I got my eraser so hard I taking labels. 02:20.950 --> 02:24.280 Remember whenever you are going to use a Lucy that is loc. 02:24.550 --> 02:28.000 So you are going to dig in intersection with labels. 02:28.000 --> 02:35.620 So I had a difference will be if I'm taking the index value as you remember will list this fifth will 02:35.620 --> 02:39.840 not be included in this case we are depending on labels. 02:39.850 --> 02:44.570 So it is working as a label and not the next value as 0 1 2 3. 02:44.620 --> 02:49.390 It is actually label and it is considering as a label name. 02:49.510 --> 02:51.700 Same for those with this particular header. 02:52.270 --> 02:59.320 So one point I need to talk about what if I need country clicks and is so all you have to do is take 02:59.410 --> 03:08.340 from countries to these so it would take country clicks and is it me execute this one. 03:08.410 --> 03:12.520 So you will get the result from country click send is search. 03:12.550 --> 03:14.220 Basically an intersection. 03:14.440 --> 03:21.090 And what we are doing is we are taking this particular part you have to be careful with slicing. 03:21.100 --> 03:24.430 And one thing you need to remember is this is not simply Nigeria. 03:24.490 --> 03:25.440 One memory. 03:25.720 --> 03:35.320 So if I use my data if one in print that you would see still having this result that means this law 03:35.410 --> 03:38.020 is not an in place operation. 03:38.050 --> 03:41.320 So you have to create a new variable and stored them. 03:41.320 --> 03:46.180 Let me create IDF to store these value inside that variable. 03:46.180 --> 03:54.250 Let me open a new shell and then print out IDF to hey you can see I got my results successfully. 03:54.250 --> 03:55.550 I hope this was clear. 03:55.780 --> 03:59.010 Let me excuse a few more resigned and they need to. 04:01.520 --> 04:04.070 What if I need a value from a single sale. 04:04.070 --> 04:09.800 Maybe a one clicks and I just want for this particular target label. 04:10.490 --> 04:12.860 So what I could do is just pass that value. 04:12.890 --> 04:21.380 So maybe I just want this three and I just want clicks. 04:21.500 --> 04:24.410 You can see the value of that has clicks. 04:24.410 --> 04:26.320 And then from third. 04:26.510 --> 04:30.040 So this looks when I'm able to get the value of singles. 04:30.380 --> 04:38.830 Now what if I need all the rules for clicks that means I need all the rules only for clicks for rows. 04:38.840 --> 04:43.340 We can get all the elements and then karma and just add click. 04:43.400 --> 04:51.720 So this will read on you the result of clicks Now this was basically important for law in which we totally 04:51.720 --> 04:52.950 depend on labels. 04:52.950 --> 04:59.100 And I really agree with that because you might be using different name instead of 0 1 to 2 you might 04:59.100 --> 05:05.520 be using some particular index like I did in the earlier videos used to set the index and then we can 05:05.520 --> 05:06.140 use that.