WEBVTT

00:00.420 --> 00:05.600
All right so finally we head into doing some numerical operations.

00:05.820 --> 00:08.930
So what we can do is we can create a new chapter in a book.

00:09.300 --> 00:13.740
Let's call it chess Nimer coal operations.

00:18.790 --> 00:21.190
And by right.

00:21.300 --> 00:23.170
So let's start.

00:23.360 --> 00:29.780
OK so first of all you know we have of course done a lot of operators in Python.

00:30.200 --> 00:39.410
And so we have seen quite a lot of things work we can do using operators but now can we apply them to

00:39.500 --> 00:41.560
by areas as a whole.

00:41.620 --> 00:48.440
Lexi First of all let's use a simple let's use a simple number that's a scalar or a simple number so

00:48.440 --> 00:50.390
let's say I'm going to use a scalar.

00:50.600 --> 00:58.250
So I'm going to define this let me call this a markdown.

00:59.690 --> 01:12.460
Just also using scalars you are with numb by x.

01:13.080 --> 01:13.600
OK.

01:13.680 --> 01:14.900
So let's begin.

01:15.090 --> 01:22.620
So let's start with adding Skelos to are supposed to fall we need to post some PI as MP.

01:22.830 --> 01:24.240
Step 1 right.

01:24.230 --> 01:25.080
Create a atom.

01:25.200 --> 01:35.500
So let's say Creedon that by saying A is equal to any DOT Terry Cross list let's say

01:39.920 --> 01:46.280
oops sorry sorry that's OK you understand finally the matter right.

01:46.420 --> 01:53.940
So finally what I want to do is I want to say an equal to a plus.

01:54.100 --> 01:58.450
I'm going to use a scalar or two that's a scalar number.

01:58.570 --> 01:59.590
Let's see what happens.

01:59.590 --> 02:00.630
Print a.

02:00.670 --> 02:03.790
Can I do this by the way.

02:03.790 --> 02:04.900
What happens.

02:04.900 --> 02:05.860
So.

02:06.130 --> 02:10.730
All right so because a new ship will connect to my server.

02:10.780 --> 02:11.050
OK.

02:11.050 --> 02:15.410
See what happened 15 to 17 right.

02:15.490 --> 02:17.620
Oops.

02:18.080 --> 02:23.100
Four plus 2 6 2 1 2 3 2 1 2 4.

02:23.240 --> 02:27.850
So if the steal or get added to each and every element in the NBA.

02:28.130 --> 02:35.450
So this is something which which you know Nonpoint us and you can use all the operators that you want.

02:35.870 --> 02:42.400
So with this let's say for example if multiplied by a multiplied by 2 a.

02:42.410 --> 02:46.540
So that would be 70 must we're about to study for six months boy choose 12.

02:46.550 --> 02:52.250
That was 2 was 1 0 6 right for the most would be to his mind 0 6 and so on.

02:52.610 --> 02:56.000
What if I do eight divided by two would be done.

02:56.150 --> 02:57.990
Oh yes it is.

02:57.990 --> 03:00.380
It will be a floating point values right.

03:00.380 --> 03:02.820
Can I do floored division.

03:02.840 --> 03:03.660
Yes I can.

03:03.690 --> 03:08.960
Where you will get all the all in the decimal portion of it or really the part of it.

03:09.380 --> 03:10.030
Correct.

03:10.800 --> 03:11.040
OK.

03:11.060 --> 03:12.650
That's about floor division.

03:12.800 --> 03:13.180
All right.

03:13.180 --> 03:21.270
Can I have modalists let's say a model is 2.

03:21.640 --> 03:24.120
So it's going to be the ones and zeros that's it.

03:24.130 --> 03:29.200
Because you know it's either divisible by 2 artists Nando's by two and after that the remainder is going

03:29.200 --> 03:31.660
to be either 1 or 0 0.

03:31.720 --> 03:33.730
That's how it's going to be.

03:33.970 --> 03:41.930
Let's say for the race to operate the works and that is you know it's us us race to our power operator.

03:42.280 --> 03:43.860
So if I say a square.

03:44.110 --> 03:45.160
Ooh that's cool.

03:45.160 --> 03:47.160
So it's great up each of the numbers.

03:47.350 --> 03:52.550
So the first one is 17 in the 17 that is 289.

03:52.600 --> 03:53.870
That's cool.

03:53.890 --> 03:58.170
So you have you have different operators that can that can work with it.

03:58.330 --> 04:04.330
Right so a scalar can be used for multiple for multiple things like this.

04:04.540 --> 04:08.300
Whereas if you had to do the same thing with the list.

04:08.680 --> 04:12.040
Oh my God how how terrible that is going to be.

04:12.040 --> 04:13.020
Let's have a look.

04:13.030 --> 04:14.650
The list is equal to.

04:14.950 --> 04:18.280
So you're going to have list is 15.

04:18.280 --> 04:20.500
Come on 21 come up 14.

04:20.500 --> 04:23.290
Come on right now or something like that.

04:23.530 --> 04:24.240
Right.

04:24.250 --> 04:26.720
So let me say this is your list.

04:27.220 --> 04:29.010
And what would I have to do.

04:29.110 --> 04:30.840
I would have to do something like this.

04:30.850 --> 04:41.500
I need a I need at least one is equal to is equal to for every element in LSD right.

04:42.290 --> 04:46.110
I'm going to do element plus two.

04:46.460 --> 04:53.780
And then I print at least those what I would have done if it was a list correct.

04:53.780 --> 04:57.850
So these are some things which got completely.

04:58.010 --> 04:58.450
Sorry.

04:58.490 --> 04:59.460
I need to print sorry.

04:59.480 --> 05:00.590
Let's do one.

05:01.370 --> 05:04.790
So there I get all my values added later.

05:05.000 --> 05:08.500
So I need to do this by looping through with.

05:08.540 --> 05:13.140
And it takes a long time but not so for a number.

05:13.160 --> 05:15.510
And that's the beauty of an umpire.

05:15.830 --> 05:18.760
So now let's go on.

05:18.760 --> 05:20.860
So this is about using scalars.

05:20.870 --> 05:25.780
Now what if I use something else live and just put his mark down and instead of using scalars.

05:25.790 --> 05:36.460
Now I'm going to say athletic and all operations on two addy's as a whole.

05:36.620 --> 05:37.610
So I'm going to do that.

05:37.610 --> 05:40.910
So I'm going to do operations on two hours completely correct.

05:41.990 --> 05:42.930
Which is going to be

05:45.580 --> 05:47.440
as we can see here.

05:47.690 --> 05:56.690
Import nut pie as MP and let's see is equal to any dot.

05:57.580 --> 06:02.830
And of course I'm going to have 11 or 12 come a 13 right.

06:02.830 --> 06:07.260
Come on come on tourney one come on 22.

06:07.260 --> 06:09.810
Come on 23 right.

06:09.840 --> 06:15.980
Come on get 31 come on 32 come on come on 33.

06:16.170 --> 06:16.510
Right.

06:16.510 --> 06:19.300
These are a few things that you can think of.

06:19.360 --> 06:27.570
I'm just creating a B I don't want to keep creating like this let me just create all ones let me say

06:27.590 --> 06:32.900
NPE dot anti-dog ones and little ones and I just create old ones altogether.

06:35.300 --> 06:37.630
So so ones.

06:37.640 --> 06:44.910
And then I can just say I just need to say all ones I want from my tree so that it's you know you don't

06:44.970 --> 06:45.460
want that.

06:45.470 --> 06:55.490
So if I can print a and print B this is what I get.

06:56.080 --> 07:00.950
Only two non keyword arguments expect where is it.

07:01.060 --> 07:03.000
Where is that.

07:03.010 --> 07:03.540
OK.

07:03.760 --> 07:06.890
Sorry I didn't I didn't create it completely.

07:07.000 --> 07:08.980
I didn't create a picture at a shy

07:12.000 --> 07:12.750
oh my

07:15.440 --> 07:16.820
cool.

07:17.240 --> 07:17.840
Yeah.

07:18.200 --> 07:25.230
So in ones and then you just put it as type as comedy type going into your.

07:25.330 --> 07:29.590
So there I have Levin got tocome in 21 22 23.

07:29.590 --> 07:31.270
And each of them is once.

07:31.330 --> 07:38.750
So this is about how you can get as close to an umpire and write it.

07:38.990 --> 07:50.120
So if this is does exactly how I want things to be in in number.

07:50.270 --> 07:52.390
All right let's.

07:52.580 --> 07:55.270
This is about Ameri I created two of them.

07:55.520 --> 08:00.500
But what we want to do I want to do arithmetic operations let's do basic addition and just check what

08:00.500 --> 08:00.990
happens.

08:01.010 --> 08:03.220
A class 3.

08:03.410 --> 08:03.930
Wow.

08:03.960 --> 08:11.750
Today it's area of plus one 12 was one turning 13 because when it adds each element one after the other

08:13.110 --> 08:18.060
one element corresponding to another element this element corresponding to this one 13 corresponding

08:18.060 --> 08:20.650
to this one called.

08:20.670 --> 08:21.590
Isn't that cool.

08:21.600 --> 08:26.130
So if I do a mine is v.

08:26.710 --> 08:29.360
That is correct.

08:29.790 --> 08:31.850
So.

08:32.310 --> 08:44.450
So if I have a multiplied by the can I do this all yes I can multiply each value by 1 11 1 1 one 1.

08:44.560 --> 08:45.470
That's it.

08:46.120 --> 08:46.680
That's it.

08:46.790 --> 08:55.930
So a multiple but it multiplies not by multiplying in the matrix multiplication manner but the multiplication

08:55.930 --> 09:00.300
of twice that's how element by an n and multiplication multiplied by B.
