1 00:00:00,490 --> 00:00:06,190 Hello and welcome back to another class of our course was the complete introduction to the science with 2 00:00:06,190 --> 00:00:06,660 Python. 3 00:00:07,120 --> 00:00:10,870 So we going to discuss we are still going to talk about some pendas operation. 4 00:00:10,870 --> 00:00:16,190 And the main operation that we are going to talk about today will be joining operation. 5 00:00:16,210 --> 00:00:18,620 So basically, what does this mean? 6 00:00:19,030 --> 00:00:19,810 It's pretty simple. 7 00:00:19,810 --> 00:00:24,520 So I'd say you guys have two databases and you want to join them together. 8 00:00:24,520 --> 00:00:32,200 So putting those two databases together to do this, you will be using the joint function and you'll 9 00:00:32,200 --> 00:00:36,910 see it's not really hard to do and it can make really good results. 10 00:00:37,420 --> 00:00:37,770 All right. 11 00:00:37,780 --> 00:00:40,930 So before we start, what we'll do is pretty simple. 12 00:00:40,930 --> 00:00:45,340 We'll import that Pendas extension. 13 00:00:56,040 --> 00:01:01,740 All right, so when this is done, what we'll do right now, we'll create our two databases, so basically 14 00:01:01,740 --> 00:01:07,670 the list that will be used inside of our database, so we'll work with the exact same thing. 15 00:01:07,690 --> 00:01:13,040 So we will work with foods and it's going to be really simple. 16 00:01:13,050 --> 00:01:16,020 So the first list will be called Food One. 17 00:01:16,900 --> 00:01:24,930 So will have our food one and basically will have the number, the name of the food and the price of 18 00:01:24,930 --> 00:01:25,200 the food. 19 00:01:25,210 --> 00:01:31,980 So basically the same thing that we used in the past that we did so basically for the number of the 20 00:01:31,980 --> 00:01:35,100 food will have numbers from one to five. 21 00:01:35,100 --> 00:01:35,910 So we will have. 22 00:01:43,740 --> 00:01:47,730 No, two points, so from one to five. 23 00:01:51,130 --> 00:01:54,820 Then we'll have the name of our foods. 24 00:01:57,490 --> 00:02:04,910 Would go so for the names like always, we'll have apple, banana chips, popcorn and pizza. 25 00:02:09,020 --> 00:02:10,190 So pretty simple. 26 00:02:26,170 --> 00:02:32,350 So chips, popcorn, and finally, pizza. 27 00:02:33,730 --> 00:02:34,090 All right. 28 00:02:37,240 --> 00:02:42,620 And finally, the last thing that we will have will be the price of our foods. 29 00:02:43,360 --> 00:02:47,140 So, as always, here, we'll have our price. 30 00:02:49,410 --> 00:02:55,920 All right, so here will enter the prices, so let's say it's going to be some random numbers. 31 00:02:55,920 --> 00:02:59,950 So let's say two, six, four, three, five. 32 00:03:00,270 --> 00:03:00,620 Here we go. 33 00:03:00,660 --> 00:03:01,530 So we have our prices. 34 00:03:01,530 --> 00:03:02,480 So we have our numbers. 35 00:03:02,850 --> 00:03:03,840 We have our names. 36 00:03:03,840 --> 00:03:05,550 We have our foods. 37 00:03:06,600 --> 00:03:07,460 We have our prices. 38 00:03:07,680 --> 00:03:08,030 All right. 39 00:03:08,040 --> 00:03:14,010 So this would be for the first part and then we'll create our second list for our second database for 40 00:03:14,010 --> 00:03:19,770 dereference I will call it food to end inside of this list. 41 00:03:20,100 --> 00:03:22,270 We will have some other variables. 42 00:03:22,270 --> 00:03:27,510 So here will enter colors, waits and finally quantities. 43 00:03:29,660 --> 00:03:36,230 So let's say colors will be in this case, to call it color. 44 00:03:38,180 --> 00:03:42,170 So for Apple, it's going to be red for banana. 45 00:03:42,200 --> 00:03:46,720 It's going to be yellow for chips. 46 00:03:46,940 --> 00:03:48,560 It's going to be orange. 47 00:03:53,450 --> 00:04:05,330 For popcorn, it's got to be white and for pizza, it's going to be, let's say, blue, because we're 48 00:04:05,330 --> 00:04:06,300 having a blue pizza. 49 00:04:07,130 --> 00:04:12,410 And finally, the last thing that we are going to use, well, we have two other two other things. 50 00:04:12,420 --> 00:04:12,780 Sorry. 51 00:04:13,100 --> 00:04:18,740 So we'll have the wait so the wait in let's say, I don't know, gram. 52 00:04:20,750 --> 00:04:21,380 So wait. 53 00:04:24,410 --> 00:04:28,400 Let's say for the wait, it's going to be in this case. 54 00:04:38,840 --> 00:04:39,670 Here we go. 55 00:04:45,170 --> 00:04:52,320 All right, then, for the week, we'll have, let's say, one hundred grams to 100 grams, 150. 56 00:04:53,740 --> 00:04:57,930 One, seven, five, and finally, two hundred twenty five Grayton. 57 00:04:58,970 --> 00:05:03,410 Finally, the last thing that we are going to have will be the quantity. 58 00:05:09,220 --> 00:05:16,900 Here we go, and we can enter it right here, so it's great for the quantity, let's say it's going 59 00:05:16,900 --> 00:05:21,170 to be one, two, one, three, four, right. 60 00:05:21,410 --> 00:05:26,740 So we have everything that we need to have that our list for the food on our list for the next thing 61 00:05:26,740 --> 00:05:31,650 that we want to do is really create our data frame. 62 00:05:31,660 --> 00:05:34,510 So basically we create the formula to create our Daraprim. 63 00:05:36,190 --> 00:05:41,330 Just a quick parenthesis, it's possible to write down a line of code that will automatically create 64 00:05:41,400 --> 00:05:48,730 ditherer frame and at the same time enter all this list of things that we will use inside of a data 65 00:05:48,730 --> 00:05:49,000 frame. 66 00:05:49,240 --> 00:05:53,890 But once again, since we are, I assume that you guys are doing this for the first time. 67 00:05:54,430 --> 00:05:55,660 I'm going in two steps. 68 00:05:55,660 --> 00:05:59,950 So basically we are entering everything right here and then we are creating that frame. 69 00:05:59,980 --> 00:06:02,260 So we will have table one in this case. 70 00:06:04,630 --> 00:06:16,330 And as always, we'll use the Penders extension Daraprim and will enter Food One, we'll do the exact 71 00:06:16,330 --> 00:06:17,860 same thing for food to. 72 00:06:22,270 --> 00:06:26,470 Here we go, so we have our table then want to do the exact same thing for the food. 73 00:06:26,510 --> 00:06:32,260 Number two, as I said, so here we start using our pendas extensions, then what we'll do with fusion 74 00:06:32,260 --> 00:06:33,010 everything together. 75 00:06:33,010 --> 00:06:36,100 So as like in the best glass, we use the fuel. 76 00:06:36,220 --> 00:06:40,690 The fusion variable will do the exact same thing, will give will give us the exact same name. 77 00:06:40,690 --> 00:06:41,860 So it's going to be fusion. 78 00:06:42,190 --> 00:06:45,500 But in this case we will work with the joint function. 79 00:06:45,820 --> 00:06:47,870 So what how exactly does this work? 80 00:06:47,890 --> 00:06:50,060 So basically we'll use the table number one. 81 00:06:50,290 --> 00:06:55,800 So it's going to be table number one dot and then we'll write down our joint functions with the joint. 82 00:06:56,080 --> 00:06:59,810 We want to join table number one with table number two. 83 00:07:00,760 --> 00:07:05,590 So in this case, we have our table number one right here that we just created that will use the data 84 00:07:05,590 --> 00:07:10,150 frame of all the elements inside of the list right here. 85 00:07:10,630 --> 00:07:16,300 And we want to join the stable one with the table, two that have been created right here that will 86 00:07:16,300 --> 00:07:19,740 use all the elements of the list right here. 87 00:07:20,080 --> 00:07:25,180 So when everything is done, we want to do is simply print our fusion Vattel. 88 00:07:25,190 --> 00:07:27,460 So we simply print fusion. 89 00:07:29,600 --> 00:07:30,030 Here we go. 90 00:07:30,440 --> 00:07:37,460 So when everything is done, we can simply run app and as you can see, we will have our two data frames 91 00:07:37,460 --> 00:07:39,430 right here mixed together. 92 00:07:39,440 --> 00:07:41,880 So basically, as you can see, we will have no one. 93 00:07:41,900 --> 00:07:42,800 It's going to be Apple. 94 00:07:43,250 --> 00:07:45,320 The price of the apple will be two dollars. 95 00:07:45,440 --> 00:07:51,350 The color of the apple is red, the weight is one hundred grams, and finally the quantity will be one. 96 00:07:51,650 --> 00:07:52,740 So what have we done? 97 00:07:52,760 --> 00:07:53,510 It's pretty simple. 98 00:07:53,510 --> 00:08:02,360 We simply joined or put it together the delete the list right here or the database that is content right 99 00:08:02,360 --> 00:08:09,320 here that that works with the list right here and the data frame or the database that is right here. 100 00:08:09,410 --> 00:08:11,720 And that works through the list right here that you can see. 101 00:08:11,720 --> 00:08:15,080 It's pretty simple to do and it can be a really effective operation. 102 00:08:15,080 --> 00:08:15,520 We can do. 103 00:08:15,530 --> 00:08:20,690 Well, there are plenty of things that you guys can do with it, but those are just the basics of what 104 00:08:20,690 --> 00:08:22,720 you can do with a joint operation. 105 00:08:23,120 --> 00:08:23,480 So that's it. 106 00:08:23,480 --> 00:08:26,390 First glance, guys, and see all our next class.