Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:11,360 --> 00:00:18,320
Hi, Ron, and welcome in this new video in this video, we're going to see a lot of think about Nampai
2
00:00:18,320 --> 00:00:23,990
library like indexing, slicing and some function very useful.
3
00:00:24,740 --> 00:00:33,440
So let's get started now by show you how to do indexing with Nampai.
4
00:00:34,040 --> 00:00:45,030
It is very easy because it is exactly as for their lists when we had lists of lists.
5
00:00:45,050 --> 00:00:48,110
So we need to do a double indexation.
6
00:00:48,110 --> 00:00:59,960
For example, if I want the coefficient at the first row and the first column I just put Urbis and Parallel
7
00:01:00,010 --> 00:01:06,900
broke it with the index of the row and a number of brackets with the index of the current.
8
00:01:07,780 --> 00:01:12,800
Then if I run the crowd, I have this number.
9
00:01:13,070 --> 00:01:25,280
So it is that we want, so we have a good indexing variant is another way to do exactly the same thing
10
00:01:25,940 --> 00:01:28,400
using just one pair of brackets.
11
00:01:28,550 --> 00:01:40,130
But with the number of the index for the row and for the column, the limited by a comma.
12
00:01:40,400 --> 00:01:52,610
So you choose the syntax that you prefer, then if you want to choose just, for example, a sub matrix.
13
00:01:55,630 --> 00:01:56,560
You can do it
14
00:01:59,170 --> 00:02:10,210
using exactly the same syntax as here, but with a range of coefficient.
15
00:02:10,540 --> 00:02:27,040
For example, I can take all the rope and just the first column, for example, to take all the rule.
16
00:02:27,580 --> 00:02:35,950
I can also just put the dual point total to Python that I want all the number of.
17
00:02:38,710 --> 00:02:52,090
I can, for example, take just the tool and one column, so you can really do what you want with this
18
00:02:52,090 --> 00:02:52,780
syntax.
19
00:02:54,220 --> 00:02:59,380
You can also choose, for example, one columns.
20
00:02:59,530 --> 00:03:04,270
So to do it, we need to combine a little bit.
21
00:03:04,510 --> 00:03:09,640
The two previous way to do indexing and slicing.
22
00:03:10,060 --> 00:03:14,860
So we need the first row and all the column.
23
00:03:23,500 --> 00:03:28,720
So it is very easy to use the indexing and the slicing.
24
00:03:28,930 --> 00:03:34,660
But again, I will invite you to try by yourself to really master it.
25
00:03:36,130 --> 00:03:42,010
Then let me show you some very useful function from the Nampai Library.
26
00:03:42,670 --> 00:03:53,020
For example, if I want the maximum value of an array, I can find it using the max function.
27
00:03:56,560 --> 00:04:04,410
So I read this point max and then I have the max value of this.
28
00:04:04,420 --> 00:04:04,810
All right?
29
00:04:05,650 --> 00:04:13,570
But sometimes, for example, we want to have the maximum value by zero or the maximum value by the
30
00:04:13,570 --> 00:04:20,330
column and not just, for example, the maximum value between all of the value in the art.
31
00:04:20,950 --> 00:04:21,250
So
32
00:04:24,010 --> 00:04:33,640
to have the maximum value for the role for the column, we are going to use exactly the same function,
33
00:04:34,060 --> 00:04:39,820
but we need to specify the access for the rule.
34
00:04:41,500 --> 00:04:46,450
Usually, we always need to put axis equal zero.
35
00:04:46,930 --> 00:04:59,800
But as we want the maximum value further rule, we need to find the maximum value for each column.
36
00:04:59,920 --> 00:05:09,550
So it is a little bit tricky to understand, but I will show you the example and you will understand
37
00:05:09,550 --> 00:05:10,240
very quickly.
38
00:05:13,060 --> 00:05:16,630
So I just.
39
00:05:21,190 --> 00:05:33,010
Put this mattress here to a better understand, think so the best value, the maximum sorry value is
40
00:05:33,010 --> 00:05:34,350
not OK.
41
00:05:35,170 --> 00:05:48,130
And if we want the maximum value by Rome, so the maximum value of this rule, then the maximum value
42
00:05:48,130 --> 00:05:55,330
of this world, then the maximum value of this rule, etc. We need to pass by the column.
43
00:05:58,040 --> 00:05:58,350
OK.
44
00:05:58,580 --> 00:06:01,760
And tell to Python that I want.
45
00:06:04,330 --> 00:06:17,860
The best value between death row, death row and disrupt, and as we can see, we have three, seven
46
00:06:18,790 --> 00:06:19,390
and nine.
47
00:06:20,050 --> 00:06:32,440
So put axis evil one is really the things to do, and it is not and never for the columns.
48
00:06:32,680 --> 00:06:34,600
It is exactly the same.
49
00:06:35,650 --> 00:06:44,980
We need to check the road and we see that for the first column, the best value is nine for a second
50
00:06:45,070 --> 00:06:47,620
column when we check all the road.
51
00:06:48,010 --> 00:06:56,410
We find that the best value is six and exactly the same for the third column.
52
00:06:57,670 --> 00:07:10,550
So with this syntax, we can have a lot of function, like find the minimum value to do it.
53
00:07:10,570 --> 00:07:14,530
We just need to put me in the seat of Max.
54
00:07:18,450 --> 00:07:25,560
We can have the mean, so the average of the value in the rent.
55
00:07:26,190 --> 00:07:33,240
So again, we just need to change the function, so it is very powerful.
56
00:07:36,350 --> 00:07:45,410
If you want the standard deviation, you can also do exactly the same, so vested interests on the deviation.
57
00:07:48,970 --> 00:07:54,400
And we have the standard deviation, so this intact is very powerful.
58
00:07:54,850 --> 00:08:02,470
There are a lot of other friction, so to run all of the above.
59
00:08:02,500 --> 00:08:12,220
I invite you to go on the Nampai documentation, but this function already the most important, I think.
60
00:08:15,610 --> 00:08:28,390
Now I will show you another way to do exactly the same thing this way is to use, for example, this
61
00:08:29,230 --> 00:08:30,940
syntax so important.
62
00:08:32,230 --> 00:08:35,680
The standard deviation function from them.
63
00:08:36,100 --> 00:08:39,850
And you need to put the array inside this.
64
00:08:41,740 --> 00:08:44,020
And now we can.
65
00:08:45,980 --> 00:08:48,410
Specified in the right or not.
66
00:08:48,620 --> 00:09:01,640
Like with this function, for example, if I specify X is equal zero, I have exactly the same number
67
00:09:02,060 --> 00:09:08,840
here and here, so it is just another way to do exactly the same thing.
68
00:09:09,170 --> 00:09:16,940
That little difference is that here we have a list and here we have a one dimensional.
69
00:09:16,970 --> 00:09:17,360
All right.
70
00:09:17,750 --> 00:09:27,380
So it is very the only difference between the results of this two function.
71
00:09:29,060 --> 00:09:37,430
Now I will show you how to use very specific function and very used function in finance.
72
00:09:38,000 --> 00:09:40,280
First, the lung function.
73
00:09:40,280 --> 00:09:50,310
So to do it, we call the lung function from the pilot and we just have to put the right inside this
74
00:09:50,330 --> 00:09:59,790
function to do the exponent show of this of all coefficient in the matrix.
75
00:09:59,870 --> 00:10:05,150
We do exactly the same, but using the function e p.
76
00:10:07,780 --> 00:10:17,590
And if I want the square root of all of the co-efficient in The Matrix again, I will do exactly the
77
00:10:17,590 --> 00:10:21,340
same thing, but with the function square root.
78
00:10:25,600 --> 00:10:37,600
So actually, we have seen a lot of things and we have to see a little thing, which is the concatenation.
79
00:10:38,800 --> 00:10:44,560
So how to merge some power between them?
80
00:10:45,220 --> 00:10:49,450
And it is very also important to know it.
81
00:10:50,140 --> 00:11:02,250
I know that I felt that all thing is important because it is a very literal crash course and I have
82
00:11:02,260 --> 00:11:04,270
really put all the necessary things.
83
00:11:04,270 --> 00:11:14,380
So actually, all the things in this course, in the Python course is very necessary to master our future
84
00:11:14,410 --> 00:11:14,920
project.
85
00:11:16,540 --> 00:11:16,870
So.
86
00:11:22,100 --> 00:11:32,480
I just copy some art, and I will show you how to concatenate it to concatenate this all right.
87
00:11:32,840 --> 00:11:37,430
I will use the concatenate function from Mumbai.
88
00:11:38,600 --> 00:11:42,860
This function needs a tipple of.
89
00:11:43,160 --> 00:11:43,580
All right.
90
00:11:43,910 --> 00:11:44,270
So
91
00:11:49,760 --> 00:11:54,320
we put our two array and we need to specify the axis.
92
00:11:57,780 --> 00:12:01,260
By which you want to concatenate.
93
00:12:01,470 --> 00:12:03,210
You are right here.
94
00:12:03,300 --> 00:12:10,200
We don't really not have a choice because we want to concatenate one dimension that RNA.
95
00:12:10,470 --> 00:12:15,480
So we just have one dimension in our.
96
00:12:15,630 --> 00:12:26,490
So automatically we can just concatenate by this dimension, which is zero because we have only one.
97
00:12:28,320 --> 00:12:34,130
And as we can see, we have merged this RNA with discovery here.
98
00:12:37,930 --> 00:12:41,230
So we can do exactly the same
99
00:12:45,850 --> 00:12:47,410
with the two dimension.
100
00:12:47,620 --> 00:12:47,980
All right.
101
00:12:48,190 --> 00:12:55,000
So I have just transformed this one dimension that I read in two dimensional arrays.
102
00:12:56,380 --> 00:12:56,770
So
103
00:13:00,550 --> 00:13:10,020
I take exactly the same syntax so we can do this concatenation this time.
104
00:13:10,060 --> 00:13:11,140
So by the third.
105
00:13:14,780 --> 00:13:19,070
Or we can do a concatenation by the column.
106
00:13:19,160 --> 00:13:28,040
So we need to specify axes in one one because it is the second axis, the first axis is the axis of
107
00:13:28,040 --> 00:13:34,820
the row and the second axis is the axis of the column, sometimes with some project.
108
00:13:34,940 --> 00:13:42,230
Not in this course, but I think it's very important to tell you that you can have, for example, matrix
109
00:13:42,230 --> 00:13:45,650
of three dimension, etc. But.
110
00:13:47,350 --> 00:13:56,320
Just know that it exists, and I think it's nuts, recommend to try to work with it.
111
00:13:56,500 --> 00:14:08,050
If you are a beginner, so now we want to join this array by the column, so we put Axis Evil one.
112
00:14:11,330 --> 00:14:13,820
It is all for the Nampai narrowly.
113
00:14:13,910 --> 00:14:20,870
And again, I will invite you to play with this to a better understanding of all the function.
11164
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.