1 00:00:01,140 --> 00:00:08,040 In this video, we will learn about index function in poverty and the practical use of the index in 2 00:00:08,040 --> 00:00:09,810 the real life project. 3 00:00:09,840 --> 00:00:11,490 So it is very important video. 4 00:00:12,330 --> 00:00:16,790 And please watch Dylan and you will learn a lot of useful tips and tricks. 5 00:00:16,800 --> 00:00:21,170 So here I took one dataset from the court cases. 6 00:00:21,180 --> 00:00:31,260 So here you can see there are we have four countries under different countries and then we have a dead 7 00:00:31,260 --> 00:00:40,960 column dead confirmed and recovered cases and we are interested in confirmed cases. 8 00:00:41,910 --> 00:00:43,700 So let's do it step by step. 9 00:00:43,710 --> 00:00:49,200 So the structure of this data set is we are having confirmed cases. 10 00:00:51,670 --> 00:00:57,270 So we have a running total of all the confirmed cases right in this. 11 00:00:57,820 --> 00:01:02,590 We don't have any information on the level. 12 00:01:03,310 --> 00:01:13,990 So first of all, we are interested in the confirmed column and confirmed column, dead column and the 13 00:01:14,260 --> 00:01:15,130 country column. 14 00:01:16,180 --> 00:01:20,470 So then we can just remove the other columns. 15 00:01:22,740 --> 00:01:32,960 And because it's very big, they're the size of this file is very big, so we don't need to render everything. 16 00:01:33,240 --> 00:01:37,740 So in this to the SEC, we are only interested in, for example, us. 17 00:01:39,270 --> 00:01:41,880 We just need to frater us. 18 00:01:45,460 --> 00:01:50,330 And here we have all the data that could belong to us. 19 00:01:50,350 --> 00:01:51,760 So here you can see. 20 00:01:55,050 --> 00:02:03,930 On the 22nd of January, we have one case than twenty third, we have again one, for example, if you 21 00:02:03,930 --> 00:02:07,800 look here, 3rd of March, we have one one eight. 22 00:02:09,160 --> 00:02:09,530 Guesses. 23 00:02:10,390 --> 00:02:18,060 So what are the actual guesses on 3rd of March, it will be one one eight minus 98, right? 24 00:02:18,400 --> 00:02:23,350 So we need to assess the value from the previous role, so. 25 00:02:25,870 --> 00:02:36,420 For example, if you look here, 98, the record is a 41 year old and the index is 440, right. 26 00:02:37,330 --> 00:02:40,570 Because the index start from the 08. 27 00:02:41,760 --> 00:02:51,570 From the position so how we can access this value, this record is very simple, we just need to click 28 00:02:51,570 --> 00:02:53,910 here effect's. 29 00:02:56,870 --> 00:03:05,050 And then we have to write in the curly bracket 40 write it to. 30 00:03:06,850 --> 00:03:17,160 And here you can see we record this record us unauthenticated is finding confirmed the number of cases 31 00:03:17,740 --> 00:03:23,640 98, but we are only interested in confirmed cases. 32 00:03:23,640 --> 00:03:28,360 So what we have right here, the name of the column is a confirmed. 33 00:03:33,160 --> 00:03:37,060 So a record 98. 34 00:03:38,320 --> 00:03:41,620 So if I copy the whole Syntex here. 35 00:03:42,730 --> 00:03:43,690 Copy and. 36 00:03:45,360 --> 00:03:55,480 Then I just need to delete custom and we need another column so that we can display value in a separate 37 00:03:55,480 --> 00:03:55,880 column. 38 00:03:56,380 --> 00:04:04,580 So what we will do, we need to add column, custom column, and you can write any name here and here. 39 00:04:04,580 --> 00:04:05,420 We need to paste. 40 00:04:06,400 --> 00:04:06,770 Right. 41 00:04:07,960 --> 00:04:10,220 So let's get. 42 00:04:12,020 --> 00:04:16,440 And here you can see the Ninety-eight is being repeated with every rule. 43 00:04:16,460 --> 00:04:22,340 But what we need the same value as we can see in the current column, we should get the same value in 44 00:04:22,340 --> 00:04:23,580 the custom column. 45 00:04:24,200 --> 00:04:31,040 So we need something like incremental op ed here, just like we do in the if she knows some other programming 46 00:04:31,040 --> 00:04:40,850 languages, the to develop and like in follow there is like is equal to zero is less than 10 and a plus 47 00:04:40,850 --> 00:04:41,170 plus. 48 00:04:41,910 --> 00:04:46,520 And then we put the incremental pressure here. 49 00:04:46,530 --> 00:04:49,560 So we need some kind of incremental operator here. 50 00:04:50,750 --> 00:04:59,660 So what we will do here, we just need to delete add column because we don't need to repeat the same 51 00:04:59,660 --> 00:05:00,590 value with every. 52 00:05:01,730 --> 00:05:02,810 So we will delete it. 53 00:05:03,500 --> 00:05:17,080 And there is one function like index column so we can apply this indexed column from like from zero 54 00:05:17,090 --> 00:05:22,760 to onward with the incremental one here you can see it is a zero. 55 00:05:23,290 --> 00:05:29,140 Let me show you in the if you click in the setting. 56 00:05:30,350 --> 00:05:35,410 So here you can see the starting index is zero and the increment is one. 57 00:05:36,170 --> 00:05:40,130 So we are getting with every increment. 58 00:05:41,090 --> 00:05:47,210 For example, if we need to increment one or two or three, then it will show values accordingly. 59 00:05:47,540 --> 00:05:54,500 If I say, OK, we need only increment of two, we will get zero two, four, six and so on. 60 00:05:55,130 --> 00:05:59,040 But we are interested in only increment one, right. 61 00:05:59,700 --> 00:06:09,080 OK, so we have incremental operating here and now try to get the same. 62 00:06:10,520 --> 00:06:18,680 So now we need to add one more column, custom column, for example, and we can again copy and paste 63 00:06:19,460 --> 00:06:22,980 the same expression that we had copied. 64 00:06:23,000 --> 00:06:31,670 So this is the name of the previous step and then the calibration that which record we want to get and 65 00:06:31,670 --> 00:06:32,650 from which column. 66 00:06:32,660 --> 00:06:33,050 Right. 67 00:06:33,260 --> 00:06:35,750 So, you know, this this whole thing text. 68 00:06:36,740 --> 00:06:40,370 If you don't know, you can watch my previous video, Barclaycard's. 69 00:06:41,980 --> 00:06:43,330 So here we need to. 70 00:06:45,000 --> 00:06:48,390 Instead of 40, we need to get this value dynamically. 71 00:06:48,420 --> 00:06:51,600 So I need to access one field here. 72 00:06:52,080 --> 00:07:00,150 So which field I need to access this fund, this index field, so how we can get in field from the from 73 00:07:00,150 --> 00:07:02,280 the table, that's a square bracket. 74 00:07:02,970 --> 00:07:08,020 And you can see index and it will start from zero. 75 00:07:08,040 --> 00:07:09,760 Here you can see zero one, two, three, four. 76 00:07:10,290 --> 00:07:16,320 First of all, it will qualify for the zero and we will get the record from the zeroth position, then 77 00:07:16,320 --> 00:07:17,500 one, then two and three. 78 00:07:17,520 --> 00:07:27,600 So because everything that we write here and our custom column, this expression repeated with every 79 00:07:27,610 --> 00:07:27,980 rule. 80 00:07:28,020 --> 00:07:28,400 Right. 81 00:07:29,040 --> 00:07:29,940 So we need to click. 82 00:07:29,940 --> 00:07:41,210 OK, so here you can see we are getting exactly the same records as we can see from the confirmed column. 83 00:07:41,730 --> 00:07:42,090 Right. 84 00:07:42,750 --> 00:07:48,020 So this is like if you see here, one one eight, we are getting it. 85 00:07:48,750 --> 00:07:51,960 So we are interested in the previous value. 86 00:07:52,120 --> 00:07:52,480 Right. 87 00:07:52,950 --> 00:08:03,780 If I say OK in the custom column, instead of getting value from zero to index, if I write here first, 88 00:08:03,780 --> 00:08:04,980 then let me assume it. 89 00:08:06,240 --> 00:08:10,530 If I write here index minus zero. 90 00:08:12,790 --> 00:08:19,940 Then a zero three zero minus one, it would be minus one and we will get nothing right. 91 00:08:20,800 --> 00:08:26,020 So and then it will go for the like for the fifth, first and then the fifth minus. 92 00:08:27,140 --> 00:08:32,220 One they fought for will always get the value from the previous. 93 00:08:32,420 --> 00:08:37,760 All right, so we just need to confirm. 94 00:08:42,210 --> 00:08:49,590 So here you can see now we are getting of 60 in front of 60. 95 00:08:49,620 --> 00:08:51,750 We're getting 58 the previous four. 96 00:08:51,810 --> 00:08:53,270 Then again, 74. 97 00:08:53,610 --> 00:08:56,750 And then in front of 74, we are getting 60. 98 00:08:56,760 --> 00:09:04,580 It is humid and you can see better than 98 inverted previous value 74. 99 00:09:04,590 --> 00:09:08,120 And here you can see previous value is 74. 100 00:09:09,390 --> 00:09:11,930 So we got one issue here. 101 00:09:12,240 --> 00:09:19,140 This is one error because there is no value available on the index, minus one. 102 00:09:20,190 --> 00:09:32,100 So what we can do here, we you have seen my my video of our error handling so we can, um, use here 103 00:09:32,400 --> 00:09:38,280 try if you don't know about this thing, you can maybe watch my video and you can see different ways 104 00:09:38,280 --> 00:09:44,340 of error handling and try and see if it is error. 105 00:09:44,560 --> 00:09:45,300 Otherwise 106 00:09:48,240 --> 00:09:49,570 then I will display it. 107 00:09:50,280 --> 00:09:51,960 Or I can right here, for example. 108 00:09:51,960 --> 00:09:52,350 Zero. 109 00:09:53,950 --> 00:09:57,430 Zero and a confirmed. 110 00:09:59,980 --> 00:10:04,540 So we can rename this column. 111 00:10:09,720 --> 00:10:11,220 Like previous 112 00:10:14,250 --> 00:10:15,300 previous cases. 113 00:10:19,160 --> 00:10:25,250 And if I add one more column, because some column. 114 00:10:27,850 --> 00:10:31,450 And the Huracan flight delay case is. 115 00:10:34,720 --> 00:10:43,510 And I can confirm minus previous cases there, so. 116 00:10:47,360 --> 00:10:58,970 OK, OK, so here you can see on this date, we are having only one case and. 117 00:11:01,910 --> 00:11:04,120 Just a minute here. 118 00:11:04,210 --> 00:11:13,430 OK, so here you can see we have private cases and delicacies and on the twenty third of January we 119 00:11:13,430 --> 00:11:15,050 have again won cases. 120 00:11:15,050 --> 00:11:24,950 So there is no change and we are getting zero because there was no new case on twenty third of January. 121 00:11:25,010 --> 00:11:25,250 Right. 122 00:11:26,000 --> 00:11:33,890 And then again on 24th of January, we have two cases because they are an intruder and two minus one 123 00:11:34,100 --> 00:11:34,540 one. 124 00:11:34,970 --> 00:11:37,010 So we are having one in the same way. 125 00:11:37,700 --> 00:11:45,410 Uh, you can watch here like in the first of March we are having seventy four point seventy four minus 126 00:11:45,410 --> 00:11:47,420 sixty eight on this date. 127 00:11:47,420 --> 00:11:51,550 We have total cases, six seventy four minus sixty eight. 128 00:11:51,550 --> 00:11:52,250 It will be six. 129 00:11:52,670 --> 00:12:02,360 So this is so in the spirit you have seen with the help of Index Collum, we can easily get the value 130 00:12:02,360 --> 00:12:03,290 from the previous.