1 00:00:00,580 --> 00:00:05,700 And we'll come back to a class of our course about the complete introduction to data science with the 2 00:00:05,700 --> 00:00:07,180 use of Python. 3 00:00:08,040 --> 00:00:14,490 So in this class, we are going to talk about another package that is included inside of SCoPI. 4 00:00:14,490 --> 00:00:18,780 And in this case, it's going to be the integration package which is integrated. 5 00:00:19,770 --> 00:00:23,490 So basically, to understand this package well, to understand what is it? 6 00:00:24,750 --> 00:00:25,980 Have a simple definition. 7 00:00:26,460 --> 00:00:32,280 Basically, the SCoPI integrates a package, will provide several integration techniques that includes 8 00:00:32,280 --> 00:00:38,190 an ordinary differential equation integrated, and the review of the model is provided by the HELP Command. 9 00:00:38,210 --> 00:00:43,950 So basically, you can use the help integrate methods for integrating functions, given function objects. 10 00:00:44,310 --> 00:00:50,730 In other words, the integration function is simply used to find displacement areas and it can deal 11 00:00:50,730 --> 00:00:52,790 with adding slices to the whole. 12 00:00:52,800 --> 00:00:54,220 So the complete hold that we have. 13 00:00:55,200 --> 00:00:57,390 So yes, it gets complicated at first. 14 00:00:57,390 --> 00:01:04,410 But once you are used to use this well, those functions, you'll see it's not that complicated. 15 00:01:05,340 --> 00:01:13,260 So to understand the integrated integrating support package, I have two functions that are not that 16 00:01:13,260 --> 00:01:19,510 complicated, but you need some basic mathematical knowledge that it's the quite function and the so 17 00:01:19,530 --> 00:01:25,140 basically the quad function will simply calculate the integral of a function which has one variable 18 00:01:25,650 --> 00:01:31,260 and the DBL quad function will calculate the double integral of a function which has to value. 19 00:01:31,300 --> 00:01:34,290 So basically we'll work with one as well as two tables. 20 00:01:34,680 --> 00:01:40,170 Once again, my goal right here is not for you to understand completely those functions, but simply 21 00:01:40,170 --> 00:01:42,540 to understand how they work. 22 00:01:44,320 --> 00:01:46,750 And after that it will simply be practice. 23 00:01:47,130 --> 00:01:47,540 All right. 24 00:01:47,550 --> 00:01:49,210 So let's start. 25 00:01:49,240 --> 00:01:51,750 So the first thing that we need to do is pretty simple. 26 00:01:51,750 --> 00:01:54,710 It's important Kibuye, as we always do. 27 00:01:55,050 --> 00:01:58,650 So we'll import Skype as S.P.. 28 00:02:00,580 --> 00:02:05,290 Then what I want to do is want to import our sub package in this case, the supposition that we will 29 00:02:05,290 --> 00:02:06,880 work with will be integrated. 30 00:02:06,900 --> 00:02:09,590 So basically, how do we import our sub package? 31 00:02:09,610 --> 00:02:14,020 It's pretty simple, right, from Skype import. 32 00:02:14,020 --> 00:02:15,460 So what exactly we want to import. 33 00:02:15,460 --> 00:02:16,730 We want to import, integrate. 34 00:02:18,610 --> 00:02:25,450 So here we have our sub package that we have the suppliers that we have just imported and now we want 35 00:02:25,450 --> 00:02:29,780 to do is want to work with our first type of function. 36 00:02:29,800 --> 00:02:33,760 So in this case, our first function will be the quad function. 37 00:02:34,360 --> 00:02:41,410 So basically the quad function will is a mirror that will that can get the integration of a given function 38 00:02:41,410 --> 00:02:45,490 from limit eight to be using our function. 39 00:02:46,000 --> 00:02:48,310 So in other words, what does it mean? 40 00:02:48,310 --> 00:02:54,190 It will simply calculate integral of a function which has one value in the difference the debulked, 41 00:02:54,400 --> 00:02:59,680 the function that we are going to talk about a bit later, we'll calculate in double integral of a function 42 00:02:59,680 --> 00:03:00,680 which has to be able. 43 00:03:00,710 --> 00:03:05,170 So basically the first one has one variable and the second one has two variables, but it's going to 44 00:03:05,170 --> 00:03:07,030 be a double integral as well. 45 00:03:08,410 --> 00:03:08,840 All right. 46 00:03:08,860 --> 00:03:11,170 So how exactly does everything work? 47 00:03:11,290 --> 00:03:12,030 Pretty simple. 48 00:03:12,850 --> 00:03:16,340 First thing that we need to do is we need to create a value. 49 00:03:16,360 --> 00:03:17,620 So let's create a variable. 50 00:03:18,070 --> 00:03:20,050 And this value, let's call it variable. 51 00:03:20,050 --> 00:03:27,160 Once we or one in this variable, what we what we'll set we'll write down our parameters. 52 00:03:28,000 --> 00:03:29,800 In this case, it's going to be lambda. 53 00:03:31,150 --> 00:03:34,810 So Lambda X two points. 54 00:03:35,080 --> 00:03:37,310 And what how exactly we want lambda x. 55 00:03:37,310 --> 00:03:40,600 So basically we want to actually X exponent three. 56 00:03:40,600 --> 00:03:46,430 So X multiplication multiplication sign two times three. 57 00:03:47,500 --> 00:03:53,800 Then why do we want to create our calculation variables, a variable where we are going to store all 58 00:03:53,800 --> 00:03:54,650 our calculation. 59 00:03:55,150 --> 00:03:57,460 So let's call it function one. 60 00:03:58,780 --> 00:04:02,300 So function one in this case will be equal to integrate. 61 00:04:02,320 --> 00:04:05,560 So once again, right now what we write down, why write down integrate? 62 00:04:05,560 --> 00:04:11,320 Because we are going to look for a function that is inside, integrate some package and the name of 63 00:04:11,320 --> 00:04:12,560 this function is Quad. 64 00:04:13,450 --> 00:04:21,490 So since we're working with the function that is integrate inside of the integrate some package we write 65 00:04:21,490 --> 00:04:27,370 down, integrate that QUAT, then next thing that we need to write down is will be our parameters. 66 00:04:27,400 --> 00:04:31,680 So the first our parameters are stored inside of one. 67 00:04:31,690 --> 00:04:37,630 So we just write down one and then we need to write down our limits or limits would be, let's say, 68 00:04:37,630 --> 00:04:39,880 between zero and six. 69 00:04:40,920 --> 00:04:41,660 All right. 70 00:04:41,690 --> 00:04:44,390 Next thing that we want to do is print everything. 71 00:04:44,410 --> 00:04:48,180 So simply write down print and what exactly what the print want to print function. 72 00:04:48,670 --> 00:04:50,710 So here it is right there. 73 00:04:51,550 --> 00:04:52,480 Then we run our up. 74 00:04:52,510 --> 00:04:55,270 So you'll see it's going to take a little bit of time. 75 00:04:55,270 --> 00:04:58,240 But in this case it was pretty automatic. 76 00:04:58,250 --> 00:05:02,100 So this would be the answer of this integration. 77 00:05:02,110 --> 00:05:04,180 So basically it will look something like this. 78 00:05:05,710 --> 00:05:06,170 All right. 79 00:05:06,190 --> 00:05:13,300 So right now that we have that, you guys saw what it looks like to to make the integrate quad function. 80 00:05:13,720 --> 00:05:17,240 Let's make it a bit more complicated and work with the double. 81 00:05:17,500 --> 00:05:23,590 So basically the double integration of in this case to viable. 82 00:05:23,650 --> 00:05:25,880 So basically, we'll have a function that has two variables. 83 00:05:25,880 --> 00:05:27,380 So X and Y. 84 00:05:28,030 --> 00:05:34,130 So what we'll do right now, we'll simply delete the first part and we'll keep everyone. 85 00:05:34,150 --> 00:05:41,890 So basically, here are one in this case will be equal to we need an X and a Y because we have in this 86 00:05:41,890 --> 00:05:43,030 case two variables. 87 00:05:43,060 --> 00:05:50,560 So basically, we'll have our Y at first, then we'll have our x ray done X and Y two points, and then 88 00:05:50,560 --> 00:05:52,610 we can write down our operations. 89 00:05:52,680 --> 00:06:03,730 Let's say in this case it's going to be X multiplied by I don't know why exponent for something like 90 00:06:03,730 --> 00:06:03,970 this. 91 00:06:05,780 --> 00:06:10,130 All right, then, when we have this, the next thing that we need to do, we'll do the exact same thing. 92 00:06:10,160 --> 00:06:17,450 So we need to create our function so the our variable, where we will store our calculation and we can 93 00:06:17,450 --> 00:06:18,460 write down our function. 94 00:06:18,480 --> 00:06:20,120 So it will work that pretty much the same way. 95 00:06:20,150 --> 00:06:22,490 So it's going to be integrated point. 96 00:06:22,520 --> 00:06:29,150 So right now, since we are since we're working with the integrated package, we start with integrate, 97 00:06:29,510 --> 00:06:32,600 then write down our function, which will be Dibbell Quod. 98 00:06:34,820 --> 00:06:36,590 So in this case, we have it right here. 99 00:06:37,800 --> 00:06:41,680 First thing that we'll write down will be our parameter parameters. 100 00:06:42,260 --> 00:06:48,100 So the one then we write down our in this case, our limits. 101 00:06:48,100 --> 00:06:53,810 So our limits, let's say, would be between zero and six like we did in our first example. 102 00:06:54,080 --> 00:06:58,460 And then we'll write down our function, which would be, let's say, for example, Lambda. 103 00:07:00,930 --> 00:07:09,060 X would be equal, will be zero and lambda X. 104 00:07:13,180 --> 00:07:13,600 One. 105 00:07:17,040 --> 00:07:18,970 All right, so we have everything that we need. 106 00:07:20,040 --> 00:07:22,830 Next thing that will do, it will simply print our function. 107 00:07:22,830 --> 00:07:31,800 So we'll print function one and we can run or so what we'll do once again, it will give us the answer 108 00:07:31,800 --> 00:07:33,670 of the double integration. 109 00:07:34,680 --> 00:07:35,090 All right. 110 00:07:35,100 --> 00:07:43,590 So as you can see, guys, yes, it's a bit more complicated to understand and to to be able to explain 111 00:07:43,740 --> 00:07:44,130 all this. 112 00:07:44,130 --> 00:07:51,360 I need to make a separate course about all those functions, because you need a good mathematical knowledge. 113 00:07:51,360 --> 00:07:52,950 You need really good mathematical knowledge. 114 00:07:53,130 --> 00:07:57,210 Once again, my goal here is really to give you an introduction so you guys understand a little bit 115 00:07:57,210 --> 00:07:58,740 how all this works. 116 00:07:59,050 --> 00:08:04,680 So if you guys are able to write down those functions, have been able to write down those functions, 117 00:08:05,040 --> 00:08:11,340 and as you can see, you have this sub package inside of Python, inside of SCoPI, sorry, that is 118 00:08:11,340 --> 00:08:18,070 inside of Python that you can use if you guys decide to make some more advanced Python apps in the future. 119 00:08:18,570 --> 00:08:19,740 So that's it for us guys, guys. 120 00:08:19,740 --> 00:08:21,810 And see all our next class.