Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:11,440 --> 00:00:18,480
Everyone and welcome in this new with you in this video, we're going to see the run them modular off
2
00:00:18,480 --> 00:00:20,220
the Nampai library.
3
00:00:21,900 --> 00:00:24,000
Run them is very important.
4
00:00:24,180 --> 00:00:30,630
When we walk in finance because a lot of things follow, run them process.
5
00:00:31,320 --> 00:00:41,580
So it is very important to understand how to simulate some random number to walk in finance.
6
00:00:44,130 --> 00:00:54,060
So let's begin by creating a random array, a one dimensional random array containing random value between
7
00:00:54,150 --> 00:00:55,320
zero and one.
8
00:00:57,060 --> 00:01:09,150
To do it, we need the library, then buy the module random and the function rent.
9
00:01:10,230 --> 00:01:17,490
And here we put the number of one, the value that we want in one dimensional.
10
00:01:17,520 --> 00:01:17,880
All right.
11
00:01:21,900 --> 00:01:36,310
And now we have random value created by Nampai, but sometimes we want, for example, a two dimensional
12
00:01:36,450 --> 00:01:46,500
array and it is necessary to transform a one dimensional way to a two dimensional.
13
00:01:46,540 --> 00:01:46,860
All right.
14
00:01:47,040 --> 00:01:53,010
So I will show you quickly how to do it because it is very important to note.
15
00:02:00,680 --> 00:02:06,350
I just print the shape, the actual shape of all.
16
00:02:09,070 --> 00:02:17,900
All right, then I will reshape it to reshape a one dimensional army in a two dimensional.
17
00:02:18,010 --> 00:02:18,250
Right?
18
00:02:18,580 --> 00:02:28,690
We just need to put an artificial column, so instead of being a number with a shape.
19
00:02:29,860 --> 00:02:35,720
Six, for example, it will be a number with a hair shape.
20
00:02:36,100 --> 00:02:39,160
Six rows and one column.
21
00:02:40,000 --> 00:02:45,910
So to do it to just had artificially this column.
22
00:02:46,900 --> 00:02:55,240
We are going to reshape this, all right, by putting minus one and one.
23
00:02:57,010 --> 00:02:58,660
And now if?
24
00:03:05,840 --> 00:03:06,260
I.
25
00:03:08,380 --> 00:03:10,480
Print again, the shape
26
00:03:14,710 --> 00:03:23,380
we can see that we have transformed our one dimensional right into a two dimensional RNA and decentralisation
27
00:03:23,500 --> 00:03:27,730
change anything in the venue of the.
28
00:03:28,270 --> 00:03:32,290
So it is very important to understand it to.
29
00:03:35,990 --> 00:03:42,260
Then sometimes we want to create a new tinker to run them the value.
30
00:03:42,320 --> 00:03:47,240
So to do it, we need to use.
31
00:03:51,690 --> 00:03:56,920
The hammering them by them, would you run them and the function runs beneath?
32
00:03:57,690 --> 00:04:04,700
So I want, for example, integral value between zero and 100.
33
00:04:04,710 --> 00:04:10,170
So I put 100 and I need to put the site.
34
00:04:10,190 --> 00:04:19,830
So if I want a matrix with five rows and five columns, I put a size of five five.
35
00:04:28,070 --> 00:04:38,900
Then we are going to see how to simulate value from one of the best known and the best famous law of
36
00:04:38,900 --> 00:04:49,430
probability in finance, which is the normal law, so to do it, we're going to use the random module
37
00:04:49,430 --> 00:04:52,340
again and the normal function.
38
00:04:54,470 --> 00:05:02,810
So we need to put the lock, which is the mean of the law.
39
00:05:03,380 --> 00:05:13,370
Then this column, which is the standard deviation of this law and we need to put the size.
40
00:05:14,120 --> 00:05:21,140
For example, if I want to create a one dimensional array, I put a size of six comma nothing.
41
00:05:25,550 --> 00:05:32,630
And if I want a two dimensional art, for example, I can do, ladies.
42
00:05:32,720 --> 00:05:36,440
Just put a number for the number of columns.
43
00:05:39,080 --> 00:05:47,030
Then let me show you a very important thing when we walk with random, when we work with random number.
44
00:05:48,440 --> 00:05:56,840
If I run again this cell, I have always another set of number.
45
00:05:58,070 --> 00:06:01,880
But sometimes if, for example, we want
46
00:06:06,530 --> 00:06:10,550
to, I don't know, share a little code or something else.
47
00:06:10,850 --> 00:06:15,980
And you have to write, for example, or we with Frizzled, et cetera.
48
00:06:17,390 --> 00:06:29,240
We need to set the scene to always have the same random number because if someone else want to verify
49
00:06:29,240 --> 00:06:34,040
something in your code, it will have always.
50
00:06:36,110 --> 00:06:43,010
No, so it will be very difficult to fix an issue, for example.
51
00:06:43,790 --> 00:06:52,250
So sometimes you need to fix the seat of the sheets, so.
52
00:06:58,180 --> 00:07:03,760
I just show you that with the same function, we have different results.
53
00:07:05,080 --> 00:07:10,000
So now I will set the scene to.
54
00:07:17,260 --> 00:07:29,410
And if and now we can see that all the time that we put there said it, all the number are the same.
55
00:07:29,440 --> 00:07:39,460
So it is very important to understand because when you find some code on GitHub to create your own project,
56
00:07:39,490 --> 00:07:48,930
et cetera, you will need to understand the code of their overall program.
57
00:07:49,090 --> 00:07:58,060
So it will be very helpful to understand this function because must of containing it.
5714
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.