1 00:00:00,510 --> 00:00:04,290 Hello, guys, and welcome back to another class of our course, I want the complete introduction to 2 00:00:04,290 --> 00:00:05,850 the science with Python. 3 00:00:06,380 --> 00:00:12,160 So in this class, we are going to learn some more mathematical operations that can be used with numbers 4 00:00:12,330 --> 00:00:13,200 on Python. 5 00:00:14,170 --> 00:00:19,140 So basically, the operations that we are going to talk about today would be all the basic operations, 6 00:00:19,140 --> 00:00:25,470 such as additional multiplying by adding and subtracting all this with arrays. 7 00:00:25,470 --> 00:00:28,810 So it's going to be basic matrix operations that I'll show you how to do. 8 00:00:28,830 --> 00:00:30,440 So we talked about it a bit earlier. 9 00:00:30,450 --> 00:00:31,910 We're just going to have a refresher. 10 00:00:32,040 --> 00:00:35,240 We're going to talk about putting everything into one single column. 11 00:00:35,760 --> 00:00:37,490 We've got to talk about some of axes. 12 00:00:37,740 --> 00:00:44,440 So basically how to make a sum of axes and the square root and the standard deviation function. 13 00:00:45,360 --> 00:00:46,230 So let's start. 14 00:00:46,620 --> 00:00:50,290 So before we start what we need, we need a Arry. 15 00:00:50,310 --> 00:00:54,960 So basically what we'll do, we'll create a two dimensional area and we'll work with it for the purpose 16 00:00:54,960 --> 00:00:56,010 of the whole course. 17 00:00:56,490 --> 00:00:59,100 So pretty simple naming are one. 18 00:01:00,120 --> 00:01:05,280 And this one dimensional area would be like always an area with even numbers. 19 00:01:06,970 --> 00:01:07,680 So here we go. 20 00:01:10,220 --> 00:01:12,230 So we'll have two, four, six. 21 00:01:19,790 --> 00:01:23,330 And the second one would be one three five. 22 00:01:24,890 --> 00:01:26,450 So, as you can see, pretty simple. 23 00:01:28,420 --> 00:01:31,480 Next thing that we will do, we'll have our second. 24 00:01:32,230 --> 00:01:34,090 So in this case. 25 00:01:36,930 --> 00:01:38,010 He was a. 26 00:01:39,890 --> 00:01:48,410 Well, we are seeing right here, which will be number two, and basically you guys can change numbers 27 00:01:48,410 --> 00:01:54,470 or you can keep the numbers as they are basically to change the numbers just for the purpose of the 28 00:01:54,470 --> 00:01:54,920 example. 29 00:01:54,920 --> 00:02:00,170 You don't need to have the same numbers as me just to show you that we can make some basic operations 30 00:02:00,200 --> 00:02:00,970 on average. 31 00:02:01,700 --> 00:02:02,060 All right. 32 00:02:02,070 --> 00:02:06,620 So the first operation that we are going to talk about in this well, and this, of course, will be 33 00:02:06,620 --> 00:02:10,010 the addition to basically how do we make basic operations? 34 00:02:10,430 --> 00:02:13,220 So metalworks operations on the air is pretty simple. 35 00:02:13,730 --> 00:02:15,080 Simply write down print. 36 00:02:16,490 --> 00:02:20,410 And from this point, what you want to do is simply select your battles. 37 00:02:20,450 --> 00:02:28,140 In this case, one plus two, and you can run the up and you will have the answer right here. 38 00:02:28,400 --> 00:02:34,100 So basically what it will do, it will simply do a basic mathematical well, a basic matrix operation. 39 00:02:34,430 --> 00:02:36,040 So in this case, it's an addition. 40 00:02:36,050 --> 00:02:38,480 So we can do the same thing for substraction. 41 00:02:40,020 --> 00:02:47,130 I can do the same thing for multiplication, so if you want to multiply errors and finally for all divisions, 42 00:02:47,790 --> 00:02:49,740 so it's going to work pretty well. 43 00:02:49,740 --> 00:02:54,510 So you can see it gives us the right answers each and every time. 44 00:02:55,320 --> 00:02:57,300 So this is for Matrix operations. 45 00:02:57,380 --> 00:02:59,830 As you can see, it's pretty simple to understand. 46 00:03:00,840 --> 00:03:01,210 All right. 47 00:03:01,950 --> 00:03:06,850 Next thing let's say you guys want to print, so you want to put everything on the same rules. 48 00:03:06,860 --> 00:03:15,450 So let's say you guys have in this case, we just kind of keep one one every so so you have this area 49 00:03:15,450 --> 00:03:18,980 that is two dimensional and you want to put everything on just one column. 50 00:03:19,620 --> 00:03:20,520 So it's pretty simple. 51 00:03:20,520 --> 00:03:21,600 How do we do this? 52 00:03:21,840 --> 00:03:32,360 So if we print the blueprint or one, then you guys can see right here that it's on two rows. 53 00:03:32,370 --> 00:03:33,600 So basically it's two rows. 54 00:03:34,740 --> 00:03:38,510 And if you want to put it on just one column, how exactly will do it do it? 55 00:03:38,520 --> 00:03:39,170 It's pretty simple. 56 00:03:39,180 --> 00:03:41,130 So I'll print both of them. 57 00:03:41,140 --> 00:03:44,890 So we'll have we'll have the original one and the other one. 58 00:03:45,330 --> 00:03:46,470 So it's going to be pretty simple. 59 00:03:46,470 --> 00:03:51,630 Simply right now we are one in this case, the name of your variable that really will 60 00:03:56,160 --> 00:03:57,510 open and close parenthesis. 61 00:04:01,560 --> 00:04:02,260 And here you go. 62 00:04:02,490 --> 00:04:06,930 So if you bring if you print it, as you can see here, you will have everything. 63 00:04:06,940 --> 00:04:13,100 So all your numbers on the same columns with just one column for all the numbers. 64 00:04:13,470 --> 00:04:13,810 All right. 65 00:04:13,830 --> 00:04:19,500 Next thing that we are going to talk about is the sum of axes and basically went on saying some of it 66 00:04:19,500 --> 00:04:28,140 says you guys can make a sum of all the columns as well as all the rules on your wealth, on your in 67 00:04:28,140 --> 00:04:28,680 this case. 68 00:04:30,270 --> 00:04:32,950 So how exactly this works, it's pretty simple. 69 00:04:32,970 --> 00:04:36,090 So once again, we have our eye right here. 70 00:04:36,990 --> 00:04:42,830 And to be able to make a sum of Xes, it's going to be a basic sum operation. 71 00:04:43,230 --> 00:04:52,200 So simply write down when your friend is here, write down the name of your function of your variable. 72 00:04:52,270 --> 00:04:54,960 So in this case, it's going to be the one that. 73 00:04:55,950 --> 00:05:02,880 So usually if you do this, if you just run a sum function, it's going to calculate the sum of your 74 00:05:02,970 --> 00:05:05,240 title of this right here. 75 00:05:05,730 --> 00:05:13,050 But in in the case, it's one, two, three, the sum of exit of the of an axis of the axis. 76 00:05:13,380 --> 00:05:15,090 The way that we do this, it's pretty simple. 77 00:05:15,100 --> 00:05:16,980 So we just open up that parenthesis. 78 00:05:18,660 --> 00:05:20,940 And from this point, we just write down axis. 79 00:05:22,930 --> 00:05:30,310 And in this case, the access could be equal to one or zero if, for example, right down zero, as 80 00:05:30,310 --> 00:05:33,750 you can see, it will calculate the sum of all the columns. 81 00:05:34,000 --> 00:05:42,970 And if we write down, one will do it will calculate the sum of all the in this case. 82 00:05:43,810 --> 00:05:45,060 So if we print both of them. 83 00:05:45,070 --> 00:05:47,350 So if I print, for example, my. 84 00:05:48,930 --> 00:05:59,060 Well, my variable in this one, and I run it so as you can see, first thing is going to be this. 85 00:05:59,340 --> 00:06:05,820 So basically if I select access equals to one, it will calculate the sum of all the numbers right here 86 00:06:05,820 --> 00:06:07,030 and all the numbers right here. 87 00:06:07,050 --> 00:06:09,910 So 12 will be the sum of six plus four plus two. 88 00:06:10,200 --> 00:06:14,970 So it's going to be 12 and nine will be the sum of five plus three plus one. 89 00:06:15,240 --> 00:06:21,790 If instead I write down equal to one to zero sorry, and I run the app, it's going to be the reverse. 90 00:06:22,230 --> 00:06:23,190 So what's going to happen? 91 00:06:23,400 --> 00:06:26,340 Three will simply be the sum of two plus one. 92 00:06:26,340 --> 00:06:30,680 Seven will be the sum of four plus three and 11 will be the sum of six plus five. 93 00:06:31,080 --> 00:06:33,480 Those can see it's pretty simple to understand. 94 00:06:34,410 --> 00:06:34,790 All right. 95 00:06:34,800 --> 00:06:39,240 So right now that you guys get the sum up axis, the next two things that we are going to talk about 96 00:06:39,240 --> 00:06:42,420 will be the square root as well as the standard deviation. 97 00:06:43,080 --> 00:06:48,930 So basically how the square root function works, it's pretty much the same as it works for if you make 98 00:06:48,930 --> 00:06:51,130 it on Pythonic without using Iris. 99 00:06:51,480 --> 00:06:56,820 So it's going to be the security function, but it's going to be written with non-pay, with the NUM 100 00:06:56,830 --> 00:06:57,600 by a feature. 101 00:06:58,170 --> 00:07:06,720 So simply write down print and keep that square so security and then you enter the name of your variable. 102 00:07:06,730 --> 00:07:11,820 So in this case, the one and you can run. 103 00:07:12,480 --> 00:07:15,880 So what it will do, it will calculate the square root of all the numbers. 104 00:07:15,900 --> 00:07:21,060 So basically the square root of two, the square root of four of six, then the square root of one right 105 00:07:21,060 --> 00:07:23,670 here in the square root of three and the square root of five. 106 00:07:24,840 --> 00:07:26,560 Same thing for the standard deviation. 107 00:07:26,670 --> 00:07:31,230 So basically what it will do, it will calculate the standard deviation of all the numbers and give 108 00:07:31,230 --> 00:07:32,520 you just one answer. 109 00:07:32,820 --> 00:07:36,220 So basically this is going to be tested. 110 00:07:36,810 --> 00:07:39,260 So if you run the app, it's going to be a bit different. 111 00:07:39,270 --> 00:07:40,800 It's going to give you just one number. 112 00:07:40,830 --> 00:07:43,960 So basically the standard deviation, all the numbers right here. 113 00:07:44,220 --> 00:07:48,070 So we talked a little bit about standard deviation in the statistical part. 114 00:07:48,360 --> 00:07:53,250 So if you guys are interested to know exactly what is the standard deviation, you can just make a research 115 00:07:53,250 --> 00:07:53,430 on it. 116 00:07:53,700 --> 00:07:58,800 But to run a standard deviation operation, it's pretty simple, simply. 117 00:07:58,800 --> 00:07:59,070 Right. 118 00:08:00,060 --> 00:08:01,390 And it will work. 119 00:08:01,420 --> 00:08:07,410 Same thing for the square root function could be really useful, for example, for the standard deviation. 120 00:08:07,440 --> 00:08:08,790 Could be really, really useful. 121 00:08:09,150 --> 00:08:14,760 If, for example, you want to compare a number to, for example, demeanor, the average, or if, 122 00:08:14,760 --> 00:08:20,070 for example, you want to calculate, I don't know, let's say the volatility of something, if something 123 00:08:20,070 --> 00:08:25,110 is really volatile or not volatile at all, if there is a big difference between the numbers between 124 00:08:25,110 --> 00:08:26,040 them or no. 125 00:08:27,060 --> 00:08:29,020 So this is for this part of the course. 126 00:08:29,050 --> 00:08:33,020 So right now, you guys know a few operations of numbers. 127 00:08:33,090 --> 00:08:38,090 There is a lot more other operations that exists, but those ones form the basis. 128 00:08:38,640 --> 00:08:41,370 So let's address those guys and see in our next.