1 00:00:00,380 --> 00:00:05,700 They've seen a fair few different ways of manipulating a race but right up the top of this section we're 2 00:00:05,700 --> 00:00:08,830 not going to go right up the top because it's pretty likely already. 3 00:00:09,000 --> 00:00:12,380 We called it manipulating and comparing arrays. 4 00:00:12,420 --> 00:00:18,120 That's what we're going to cover in this video is comparison operators will make a nice little hitting 5 00:00:19,110 --> 00:00:20,910 comparison operators. 6 00:00:20,910 --> 00:00:21,720 Beautiful. 7 00:00:21,750 --> 00:00:23,020 That's how we spell operators. 8 00:00:23,040 --> 00:00:24,980 Change it to markdown. 9 00:00:25,170 --> 00:00:28,620 Now you might have seen comparison operators in python. 10 00:00:28,620 --> 00:00:34,200 Well the good news is that in umpire race you can use those same comparison operators. 11 00:00:34,230 --> 00:00:35,480 So let's have a look. 12 00:00:35,550 --> 00:00:40,240 Let's get back our trusty a 1 in a 2 arrays. 13 00:00:40,260 --> 00:00:40,820 Wonderful. 14 00:00:41,670 --> 00:00:42,420 Let's try it out. 15 00:00:42,420 --> 00:00:47,550 We want a one greater than a two. 16 00:00:47,550 --> 00:00:51,910 What's this going to return it's going to return another array. 17 00:00:51,920 --> 00:00:54,760 Because that's the fundamental data type of num pi. 18 00:00:54,800 --> 00:00:57,680 Basically everything is an array an ending array. 19 00:00:57,890 --> 00:01:05,210 It's gonna tell us whether each element in A1 is greater than each element in A2. 20 00:01:05,360 --> 00:01:11,000 So I can see one is not created and one is equal to 1 One two is not greater than two it's a good two 21 00:01:11,570 --> 00:01:15,700 three is not great and three point three because three point three is higher. 22 00:01:15,800 --> 00:01:16,730 So let's have another look. 23 00:01:17,180 --> 00:01:23,350 Let's go a one greater than or equal to A2. 24 00:01:23,750 --> 00:01:25,320 Now we can see we've got some. 25 00:01:25,340 --> 00:01:28,640 So we got some bullying data types been return in this array. 26 00:01:28,860 --> 00:01:38,600 So maybe if we go ball array equals that ball array we want to see that and then we want to go type. 27 00:01:38,780 --> 00:01:39,410 You know the type. 28 00:01:39,410 --> 00:01:40,270 Let's see it anyway. 29 00:01:40,340 --> 00:01:40,890 Type. 30 00:01:41,330 --> 00:01:42,680 It's gonna be in the array 31 00:01:45,780 --> 00:01:51,730 and then if we also wanted bool array D type it's gonna be data type ball. 32 00:01:51,730 --> 00:01:53,800 So this array is full of both lanes here. 33 00:01:53,800 --> 00:01:54,850 Wonderful. 34 00:01:54,850 --> 00:01:57,430 So now we can see again we've got a one. 35 00:01:57,610 --> 00:02:02,690 Let's try another comparison of just a simple Antigua a one greater than five. 36 00:02:02,740 --> 00:02:05,210 Not false false false. 37 00:02:05,260 --> 00:02:05,560 Let's go. 38 00:02:05,590 --> 00:02:08,230 I won less than five. 39 00:02:08,230 --> 00:02:09,410 True true true. 40 00:02:09,550 --> 00:02:10,610 Wonderful. 41 00:02:10,660 --> 00:02:12,800 We want to see if two arrays are equal. 42 00:02:12,850 --> 00:02:15,800 We can use the equal then comparison operator. 43 00:02:16,240 --> 00:02:18,490 That's a mouthful for me. 44 00:02:18,490 --> 00:02:21,060 True true true that makes sense. 45 00:02:21,180 --> 00:02:25,130 A1 equals A. 46 00:02:25,540 --> 00:02:26,470 Wonderful. 47 00:02:26,470 --> 00:02:29,480 We can see that the first two elements. 48 00:02:29,510 --> 00:02:30,750 Oh let's go back down. 49 00:02:30,790 --> 00:02:33,230 So we're not scrolling all the time. 50 00:02:33,350 --> 00:02:38,930 A 1 another cell here a 2. 51 00:02:39,020 --> 00:02:44,270 And we can see our element 0 is true element 1 is true. 52 00:02:44,270 --> 00:02:46,050 And then the rest aren't equal. 53 00:02:46,150 --> 00:02:46,960 Okay. 54 00:02:47,030 --> 00:02:51,060 Now if you wanted to find more of these comparison operators we've just been through a few. 55 00:02:51,170 --> 00:02:53,130 You can try out some of your own. 56 00:02:53,390 --> 00:02:54,790 Let's look up the documentation. 57 00:02:54,800 --> 00:03:02,050 None pi comparison operators logic functions. 58 00:03:02,070 --> 00:03:03,200 Yeah let's have a look at this. 59 00:03:05,100 --> 00:03:07,850 All any array contents. 60 00:03:07,920 --> 00:03:09,680 There's a fair few here. 61 00:03:10,020 --> 00:03:11,690 Less less equal. 62 00:03:11,700 --> 00:03:15,540 Equal we can use these symbols here. 63 00:03:15,550 --> 00:03:17,670 Okay so there's a fair few more that we can do. 64 00:03:17,680 --> 00:03:22,600 But these the main ones that you'll need if you ever need to compare arrays you can use the exact same 65 00:03:22,600 --> 00:03:25,920 symbols that you use in Python with NUM pi. 66 00:03:26,060 --> 00:03:30,180 So that's gonna wrap up there manipulating and comparing a range section. 67 00:03:30,220 --> 00:03:33,470 Let's go have a look at the next part you'll see in the next video.