1 00:00:00,150 --> 00:00:06,150 Hello, in the previous session, we all have performed lots of analysis on our data from important 2 00:00:06,160 --> 00:00:09,930 data, are doing lots of analysis, you do completely module. 3 00:00:09,930 --> 00:00:12,540 We have solved a complex problem statement. 4 00:00:12,810 --> 00:00:16,290 And in this session we have this two problem statement. 5 00:00:16,290 --> 00:00:24,060 The very first one, we have to analyze which base number gets popular by Montani. 6 00:00:24,180 --> 00:00:30,010 It means I have to group my data on the basis of base number and one as well. 7 00:00:30,510 --> 00:00:34,470 So let me show you what exactly is a data frame here. 8 00:00:34,470 --> 00:00:36,270 So this is exactly why data frame. 9 00:00:36,600 --> 00:00:41,730 So on this what I have to do, I have two very first group it on the basis of base. 10 00:00:42,060 --> 00:00:45,200 After that, I have to group it on the basis of month. 11 00:00:45,480 --> 00:00:49,490 So I'm just going to say D.F. Dot group by. 12 00:00:49,530 --> 00:00:57,090 And here I have to say very first I had a group on the basis of base, then after I had a group on the 13 00:00:57,090 --> 00:01:05,340 basis of one that said once I have all this stuff, I have to simply access this data over here. 14 00:01:05,580 --> 00:01:14,220 And whatever the time I have over here on this, I have to simply perform this count operation that 15 00:01:14,400 --> 00:01:16,370 it just executed. 16 00:01:16,370 --> 00:01:22,740 It will take some couple of seconds and it will return to some beautiful stats you will see with respect 17 00:01:22,740 --> 00:01:23,130 to this. 18 00:01:23,130 --> 00:01:24,810 With no having this this month. 19 00:01:24,810 --> 00:01:26,250 You have this this values. 20 00:01:26,250 --> 00:01:32,190 Let's say I have to create its data form so far that I'm just going to call this reset on this index 21 00:01:32,190 --> 00:01:32,850 over here. 22 00:01:33,120 --> 00:01:35,970 And after doing this, I have to store it somewhere else. 23 00:01:36,180 --> 00:01:38,820 So this is exactly my base data frame. 24 00:01:38,820 --> 00:01:46,770 And after it, I have to just print money as it just get executed and it will definitely return as this 25 00:01:46,770 --> 00:01:48,360 beautiful little phrase. 26 00:01:48,390 --> 00:01:51,270 Now you will see this back to each and every base number. 27 00:01:51,510 --> 00:01:56,130 You have some kind of values that let's say what I'm going to do. 28 00:01:56,250 --> 00:02:01,950 I have to simply visualize which base number gets popular by month name. 29 00:02:01,990 --> 00:02:08,490 So for this, I'm just going to use my line plot that you can use your Lindberg's on Gartley. 30 00:02:08,490 --> 00:02:12,240 Either you can use from Metalocalypse, either you can use on Seabourne. 31 00:02:12,240 --> 00:02:13,170 It's all up to you. 32 00:02:13,440 --> 00:02:15,390 So let me use Likert from Seimone. 33 00:02:15,390 --> 00:02:24,660 So I'm going to say as an dot line plot and just shift Gustav and all your costs about Iapetus in front 34 00:02:24,660 --> 00:02:25,080 of you. 35 00:02:25,530 --> 00:02:27,930 So here are the very first on X axis. 36 00:02:27,930 --> 00:02:33,120 I just need my mind and definitely on Y axis. 37 00:02:33,390 --> 00:02:37,430 I just want my count, which is exactly my time. 38 00:02:37,920 --> 00:02:44,520 Once I have all the stuff, let's say I have to split my line plot on the basis of base. 39 00:02:44,530 --> 00:02:48,030 So I'm going to say on the basis of base, I have to split it. 40 00:02:48,420 --> 00:02:51,450 Then I have to measure what exactly mine it are famous. 41 00:02:51,930 --> 00:02:54,000 So my data frame is exactly my base. 42 00:02:54,710 --> 00:02:59,820 I have to customize my fit because the thought is I have to set my own trigger site. 43 00:03:00,060 --> 00:03:08,280 So I am going to split dot figure and here I have to set my own finger side like the size of Stankonia 44 00:03:08,290 --> 00:03:11,760 six, whatever side you want, just executed. 45 00:03:11,760 --> 00:03:17,610 It will take some couple of seconds, but now you will see where here this is with respect to each and 46 00:03:17,610 --> 00:03:20,670 every piece number and this green line. 47 00:03:20,670 --> 00:03:27,150 You can definitely come up with this cantus and yeah, this base number, which is exactly be zero to 48 00:03:27,150 --> 00:03:31,140 six and seven, gets popular bi monthly. 49 00:03:31,470 --> 00:03:35,730 That's a type of conclusion you can fetch from this visit. 50 00:03:36,060 --> 00:03:43,200 So let's go ahead with our next problem, a statement in which you have to perform cross analysis using 51 00:03:43,200 --> 00:03:44,370 your heat map. 52 00:03:44,370 --> 00:03:49,320 And if you guys are not that much of it, what exactly is a heat map? 53 00:03:49,680 --> 00:03:57,360 So heat map is advance level of radiation, which definitely uses my data or my magic. 54 00:03:57,450 --> 00:04:04,410 And wherever the value of that particular data add, that particular index will be high and heat map 55 00:04:04,410 --> 00:04:08,760 will rate on that particular index as a higher density. 56 00:04:08,760 --> 00:04:10,380 That's what my heat map will do. 57 00:04:10,800 --> 00:04:14,790 So here what I am going to do, I'm just going to where it goes. 58 00:04:14,820 --> 00:04:16,410 I have to define some functions. 59 00:04:16,410 --> 00:04:17,070 So let me check. 60 00:04:17,070 --> 00:04:18,750 What exactly is the problem statement? 61 00:04:18,750 --> 00:04:19,710 The very first one. 62 00:04:19,950 --> 00:04:21,030 Yeah, the very first one. 63 00:04:21,030 --> 00:04:28,140 I have to perform a heat map between this hour and then it means I have to group my data on the basis 64 00:04:28,140 --> 00:04:30,210 of this week and hour. 65 00:04:30,510 --> 00:04:38,370 So for this what you guys can do very us, I'm just going to say dot gloopy and here I have to group 66 00:04:38,370 --> 00:04:40,740 my data on the basis of the day. 67 00:04:41,160 --> 00:04:45,480 After that, I have to group my data on the basis of this hour. 68 00:04:45,900 --> 00:04:50,130 Once I have all this stuff, let's say very first I have defined some functions. 69 00:04:50,130 --> 00:04:52,680 I'm just going to define a function using that keyword. 70 00:04:52,980 --> 00:04:58,560 And here my function name is like, say, count on the school rules that count my number of rules. 71 00:04:58,830 --> 00:04:59,730 And here. 72 00:05:00,020 --> 00:05:07,460 It will exactly receive some barometer and on the basis of barometer here, I'm going to say just return 73 00:05:07,460 --> 00:05:07,820 land. 74 00:05:08,210 --> 00:05:14,810 So here I'm going to say return land of whatever parameter in this function will receive. 75 00:05:14,840 --> 00:05:16,980 So here I'm going to say it is my rules. 76 00:05:17,420 --> 00:05:24,630 So this function, this does so now I have just executed and now here I have to just apply this count 77 00:05:24,650 --> 00:05:25,750 and a squirrel's function. 78 00:05:26,000 --> 00:05:30,830 So don't apply, count, underscore. 79 00:05:31,400 --> 00:05:33,200 So this is exactly my function name. 80 00:05:33,540 --> 00:05:37,510 So if I'm going to execute it, it will fit into some values order. 81 00:05:37,580 --> 00:05:40,570 And here you will see this is my day. 82 00:05:40,620 --> 00:05:43,600 This is our and here I have some values. 83 00:05:43,610 --> 00:05:47,330 It means having this week and having this hour. 84 00:05:47,570 --> 00:05:50,050 I have that much number of count. 85 00:05:50,240 --> 00:05:52,150 Let's say I have to store it somewhere else. 86 00:05:52,210 --> 00:05:58,100 Let's say I'm going to say it is exactly my let's say because whatever name you want to assign, it's 87 00:05:58,100 --> 00:05:58,640 all up to you. 88 00:05:59,000 --> 00:06:00,770 So this is exactly my Bycroft. 89 00:06:00,770 --> 00:06:03,050 And after it, I'm also going to print it. 90 00:06:03,290 --> 00:06:03,880 That's it. 91 00:06:03,920 --> 00:06:04,480 That's OK. 92 00:06:04,760 --> 00:06:09,850 And after what I have to do, let's say I have to create it's pivot table. 93 00:06:09,860 --> 00:06:16,970 So far this what I'm going to do, whatever, because I have on this, I am basically going to call 94 00:06:16,970 --> 00:06:23,660 this stack operation that said it will convert it into my pivot table. 95 00:06:23,660 --> 00:06:27,290 So I'm just going to store it in, say, pivot and eat. 96 00:06:27,560 --> 00:06:28,490 Exactly. 97 00:06:28,490 --> 00:06:32,060 Let's say I have to print might be so just executed. 98 00:06:32,060 --> 00:06:40,190 And this is a beautiful pivot table where you have your data in the form of here you have all the indexes 99 00:06:40,400 --> 00:06:45,080 here, your Vectibix indexes and our become columns. 100 00:06:45,080 --> 00:06:51,590 And if, let's say in this in this matrix or in this data, let's say if you have to come up with some 101 00:06:51,590 --> 00:06:59,720 conclusion on what we did and on what our your rights or maximum are, you have a maximum count. 102 00:06:59,930 --> 00:07:03,390 So it is hard to visualize from this huge chunk of data. 103 00:07:03,710 --> 00:07:10,190 So in such scenarios, in such scenarios, your heat map is going to be pineal over here so that if 104 00:07:10,420 --> 00:07:15,350 you have to use your heat map here, here, I'm going to say S.A.S. dot heat map. 105 00:07:15,710 --> 00:07:18,400 And here you have to just mention your field. 106 00:07:18,620 --> 00:07:21,530 So I'm just going to mention my pivot and two. 107 00:07:21,830 --> 00:07:25,920 And if I'm going to execute it, let me execute and let me show you a thing. 108 00:07:26,570 --> 00:07:33,320 Now you'll see over here, this is your favorite table, but still it doesn't look that much user-friendly. 109 00:07:33,620 --> 00:07:36,790 So you have to just customize it for this. 110 00:07:36,800 --> 00:07:44,360 Let's say I'm going to say blt dot figger and here I have a parameter which is fixit, let's say my 111 00:07:44,360 --> 00:07:44,880 figures. 112 00:07:44,930 --> 00:07:52,030 I just again executed and now up to some greater extent it is somehow very good. 113 00:07:52,040 --> 00:07:58,310 And from this heat map you will see this is exactly what color bar and you will visualize over here 114 00:07:58,310 --> 00:08:04,160 in this almost in this evening time, almost in each and every day you have a rush. 115 00:08:04,430 --> 00:08:08,360 So that's a type of entrance you can easily fetch from this heat map. 116 00:08:08,510 --> 00:08:12,470 But you can't find this in friends from this Beattyville. 117 00:08:12,800 --> 00:08:21,100 So whenever you have a huge chunk of data at the time, your heat map is going to be final order almost 118 00:08:21,110 --> 00:08:25,460 in 90 percent of cases, even machine learning as well. 119 00:08:25,640 --> 00:08:28,420 So here what I'm going to do let's see here. 120 00:08:28,430 --> 00:08:35,180 My problem statement was I have to perform this heat map for our day and for a month and day and from 121 00:08:35,180 --> 00:08:36,730 month and week as well. 122 00:08:37,100 --> 00:08:40,660 So let's say I have to perform a similar operation and again and again. 123 00:08:40,940 --> 00:08:43,190 So why not try to just create a function? 124 00:08:43,190 --> 00:08:51,110 Because whenever you have to perform certain tasks again and again, the best way is to create a function 125 00:08:51,110 --> 00:08:56,690 over there so that if I have to define some function, let's say that function name is nothing, but 126 00:08:56,690 --> 00:08:58,820 let's say function, name is heightmap. 127 00:08:59,060 --> 00:09:03,290 So I'm just going to define some function and it will assume some parameters. 128 00:09:03,290 --> 00:09:04,540 I can define it later. 129 00:09:05,150 --> 00:09:08,980 So very first, I just need I just need some people. 130 00:09:09,030 --> 00:09:14,360 David, so let me just copy this code over here, which is exactly this one. 131 00:09:14,840 --> 00:09:19,000 And this is exactly code that I have copied and I have to do it here. 132 00:09:19,280 --> 00:09:19,670 Here. 133 00:09:19,670 --> 00:09:23,510 I have to just do some modification here. 134 00:09:23,510 --> 00:09:30,500 I'm going to say I have to see my very first column, but then I have column two and here I have to 135 00:09:30,500 --> 00:09:35,090 just set the set here, my column one here, my column two. 136 00:09:35,600 --> 00:09:42,080 After doing all these things, what I am going to do, I have to convert it into some B whatever for 137 00:09:42,080 --> 00:09:42,380 this. 138 00:09:42,380 --> 00:09:45,260 Either you can type manually or you can do copy paste. 139 00:09:45,260 --> 00:09:46,250 That's all up to you. 140 00:09:46,430 --> 00:09:53,060 So I have to just copy paste or they are just copy, just be so in disfavoured. 141 00:09:53,060 --> 00:09:54,770 You have your periodic table. 142 00:09:55,070 --> 00:09:58,910 After doing all these things, you have to just visualize your. 143 00:10:00,250 --> 00:10:07,300 That said, and here I'm just going to paste, and here you have to provide proper indentation, otherwise 144 00:10:07,300 --> 00:10:09,860 it will give us some added. 145 00:10:10,150 --> 00:10:16,990 And what I have to do, I have to simply return this heat map and warns if I'm going to execute it. 146 00:10:17,260 --> 00:10:22,030 Now, our problem is statement was I have to perform it for our. 147 00:10:22,120 --> 00:10:28,060 And so for this what I'm going to do, I'm just going to call this our heat map function, which is 148 00:10:28,060 --> 00:10:29,560 exactly this heat map. 149 00:10:29,830 --> 00:10:31,690 And here my very first parameter. 150 00:10:31,710 --> 00:10:37,930 Exactly the second parameter is exactly what that said, just executed. 151 00:10:37,930 --> 00:10:43,390 It will take some couple of seconds and it will return as my beautiful heat map in a while. 152 00:10:43,750 --> 00:10:48,280 And now you will figure out this is a beautiful heat map here. 153 00:10:48,430 --> 00:10:53,160 And from this beautiful heat map, you can definitely come up with a conclusion. 154 00:10:53,200 --> 00:10:53,680 Yeah. 155 00:10:54,160 --> 00:11:01,450 In each and every evening, almost in each and every day, you have certain kind of rush, whereas whereas 156 00:11:01,660 --> 00:11:05,410 in this midnight you don't have any kind of rush. 157 00:11:05,410 --> 00:11:11,470 Because I have I had this little bar over here and depending upon this color bar, I can definitely 158 00:11:11,470 --> 00:11:13,900 come up with some conclusion in a similar way. 159 00:11:13,900 --> 00:11:19,290 You can perform both the problem statement by just passing parameter. 160 00:11:19,300 --> 00:11:21,580 That's a very piece of cake lighting. 161 00:11:21,970 --> 00:11:23,890 So that is exactly the assignment. 162 00:11:23,890 --> 00:11:27,250 And you have to infer from this as well that it's not like that. 163 00:11:27,340 --> 00:11:29,920 You have to just pass this parameter and that's okay. 164 00:11:29,950 --> 00:11:37,630 You have to infer from this heat map as well, because if you're confused, because if your visual isn't 165 00:11:37,660 --> 00:11:42,390 going to conclude anything, then it makes no sense for analysis. 166 00:11:42,400 --> 00:11:45,990 So that's all about this session of the session very much. 167 00:11:46,000 --> 00:11:46,700 Thank you. 168 00:11:46,750 --> 00:11:47,690 Have a nice day. 169 00:11:47,710 --> 00:11:48,540 Keep learning. 170 00:11:48,550 --> 00:11:49,450 Keep going. 171 00:11:49,600 --> 00:11:50,470 Keep practicing.