1 00:00:00,340 --> 00:00:05,400 Helgason, welcome back to another class of our course about the complete introduction to data science. 2 00:00:06,000 --> 00:00:09,430 So in today's class, we are going to learn how to use. 3 00:00:09,830 --> 00:00:15,750 So basically, we're going to learn how to create tables inside of pendas with the use of Python codes 4 00:00:15,750 --> 00:00:18,570 as well as Banda's operations. 5 00:00:19,740 --> 00:00:20,900 So it's pretty simple. 6 00:00:21,090 --> 00:00:23,220 Let me just explain you what I mean by table. 7 00:00:23,230 --> 00:00:25,750 So let me just open up this little Excel folder. 8 00:00:26,130 --> 00:00:31,470 So basically what I mean by tables is just creating your first little database inside of Python. 9 00:00:31,950 --> 00:00:36,140 So basically, you guys will recreate this little database inside of Python. 10 00:00:36,150 --> 00:00:38,060 So I created something that is pretty simple. 11 00:00:38,070 --> 00:00:39,000 So we have numbers. 12 00:00:39,000 --> 00:00:45,960 We have the names of employees associated with their numbers and finally we have their hourly salary 13 00:00:45,960 --> 00:00:47,570 or how much they earn per hour. 14 00:00:48,480 --> 00:00:54,300 So let's say you guys have all this on Excel and now you want to put all this on Python. 15 00:00:54,750 --> 00:00:56,470 So how will it work? 16 00:00:56,760 --> 00:00:57,710 So it's pretty simple. 17 00:00:57,720 --> 00:01:04,350 The first thing that you guys will need to do is open up your app by Tromso right here and import Banda's 18 00:01:04,350 --> 00:01:04,910 Aspley. 19 00:01:04,920 --> 00:01:07,620 So import it could be speedier as anything you want. 20 00:01:08,670 --> 00:01:14,400 So basically we import Banda's does the first thing because we want to use some up models or expand 21 00:01:14,610 --> 00:01:19,330 operations inside of our well when we will create our database. 22 00:01:19,950 --> 00:01:20,350 All right. 23 00:01:20,380 --> 00:01:24,090 Next thing that we want to do is give a name to our database. 24 00:01:24,120 --> 00:01:28,710 So basically it's going to be employee and inside of employee. 25 00:01:29,070 --> 00:01:35,500 We are going to store all the data that is going to be used to create our table or our database. 26 00:01:36,030 --> 00:01:36,360 All right. 27 00:01:36,370 --> 00:01:38,160 So we will start the creation. 28 00:01:38,190 --> 00:01:41,610 So right now, the first thing that we'll do will open up parenthesis like this. 29 00:01:42,420 --> 00:01:45,280 And the first thing is we want to enter all the numbers. 30 00:01:45,300 --> 00:01:52,170 So basically, you open up you right down to like this and you write down number from this moment to 31 00:01:52,170 --> 00:01:54,700 points and you enter all the numbers that you have. 32 00:01:54,720 --> 00:01:56,500 So what are the numbers that we have? 33 00:01:56,520 --> 00:02:00,080 We have one, two, three, four, as well as five. 34 00:02:00,990 --> 00:02:02,760 We do the exact same thing for names. 35 00:02:02,790 --> 00:02:04,650 So basically two commas like this. 36 00:02:04,650 --> 00:02:09,000 We write the name and then we enter all the names that we have. 37 00:02:09,540 --> 00:02:12,160 So basically, in this case, what are the names that we have? 38 00:02:12,180 --> 00:02:15,390 We have A, B, John, Mark and Bob. 39 00:02:16,620 --> 00:02:19,320 But basically those are all the names that we have. 40 00:02:22,970 --> 00:02:23,890 So here we go. 41 00:02:30,620 --> 00:02:37,130 So we have Amy, John Lennon, Mark and Bob, and that basically you guys can write down as many rules 42 00:02:37,130 --> 00:02:37,610 as you want. 43 00:02:37,640 --> 00:02:44,540 So each thing like this is one route and this is all the elements that are part of the rules. 44 00:02:44,540 --> 00:02:46,700 So basically, we have numbers one, two, three, four, five. 45 00:02:46,710 --> 00:02:49,550 We have names and then we will have hourly salary. 46 00:02:49,550 --> 00:02:54,260 If you guys want to add some other things, for example, where they live, where they work and any 47 00:02:54,260 --> 00:02:56,720 other thing, it could work as well. 48 00:02:57,260 --> 00:02:57,550 All right. 49 00:02:57,560 --> 00:03:00,870 So the last thing, as I said, will be the hourly salary. 50 00:03:00,980 --> 00:03:02,660 So in this case, write it down. 51 00:03:03,020 --> 00:03:06,200 So hourly salary. 52 00:03:08,450 --> 00:03:15,790 Then you write down your two points, as always, so it's going to be 15, twenty five, thirty to twenty 53 00:03:15,800 --> 00:03:17,660 seven as well as 40. 54 00:03:18,710 --> 00:03:19,040 All right. 55 00:03:19,050 --> 00:03:20,900 So right now we have everything that we need. 56 00:03:21,380 --> 00:03:25,140 Very important to check for errors if we didn't make no errors. 57 00:03:25,160 --> 00:03:27,600 So as we can see, everything is pretty good. 58 00:03:28,970 --> 00:03:32,650 Next thing I want to do is print everything and look what it looks like. 59 00:03:32,660 --> 00:03:36,560 So you will see it's not going to be as pretty as you think. 60 00:03:36,590 --> 00:03:38,320 So basically it will print employee. 61 00:03:40,040 --> 00:03:42,910 So it's all going to be in a form offline. 62 00:03:42,920 --> 00:03:44,690 So as you can see, it looks something like this. 63 00:03:45,020 --> 00:03:51,510 So it's definitely not like a table, like a table right here like table that is right here. 64 00:03:51,920 --> 00:03:59,540 So what I do right now is we want to use a want to use pendas to be able to generate something there 65 00:03:59,810 --> 00:04:02,040 that is more nice to see. 66 00:04:02,660 --> 00:04:03,020 All right. 67 00:04:03,030 --> 00:04:05,000 So what exactly will do right now? 68 00:04:05,990 --> 00:04:14,000 So we will put everything, everything that is right here inside of a table or inside of a data database. 69 00:04:14,330 --> 00:04:18,010 So you can you will need to give a name to this database or to this table. 70 00:04:18,020 --> 00:04:19,940 So let's call it table one. 71 00:04:20,300 --> 00:04:24,110 So in this case, it's going to be table one and table one will be equal to. 72 00:04:24,320 --> 00:04:29,090 So first thing we will write down because we are going to refer to PD operations. 73 00:04:29,390 --> 00:04:31,490 So it's going to be PD dot data. 74 00:04:32,120 --> 00:04:39,140 So we are going to create a data frame and we want this data frame where we want this data frame to 75 00:04:39,140 --> 00:04:40,110 go find data. 76 00:04:40,280 --> 00:04:43,830 So we want the data from finding its data inside of employees. 77 00:04:43,850 --> 00:04:46,740 So this is all the data that we have created. 78 00:04:47,090 --> 00:04:52,040 So this is all the data of our database and we want to create a data frame with this database. 79 00:04:52,370 --> 00:04:54,850 And the name of this data frame will be table one. 80 00:04:55,940 --> 00:04:56,270 All right. 81 00:04:56,280 --> 00:05:00,260 So what will you write down inside of our data frame will simply be employed. 82 00:05:01,790 --> 00:05:02,090 All right. 83 00:05:02,100 --> 00:05:07,130 So if we run our app again, we're going to receive the exact same thing because we are still running 84 00:05:07,130 --> 00:05:08,300 the employee. 85 00:05:09,850 --> 00:05:15,760 The employee data, so basically what you'll receive will receive screwed that up like this, but if 86 00:05:15,760 --> 00:05:22,480 we want to receive our table, so basically we will need to run our table one and in this case will 87 00:05:22,480 --> 00:05:27,080 receive our data from our database and a more nice way. 88 00:05:27,100 --> 00:05:28,890 So basically, we have it right here. 89 00:05:29,230 --> 00:05:32,060 So no one will be able number two will be done. 90 00:05:32,080 --> 00:05:33,170 Number three will be llena. 91 00:05:33,190 --> 00:05:34,280 Number four will be Mark. 92 00:05:34,300 --> 00:05:35,950 And number five will be Bubp. 93 00:05:37,300 --> 00:05:45,680 So you can see we have our five employees in a form of data from or, well, a database that is, well, 94 00:05:45,760 --> 00:05:48,730 more well, better presented. 95 00:05:49,780 --> 00:05:55,810 So right now, guys, you should be able to create your own database by using pandas and python combined 96 00:05:55,810 --> 00:05:56,300 together. 97 00:05:56,680 --> 00:05:57,370 So that's it for this. 98 00:05:57,370 --> 00:05:57,850 Guys, guys. 99 00:05:57,850 --> 00:06:02,980 And see all in our next class where we are going to learn some other basic pandas operations.