1 00:00:01,550 --> 00:00:06,830 Hello and welcome back to another class of our course about the complete introduction to the science 2 00:00:06,830 --> 00:00:07,760 with Python. 3 00:00:08,510 --> 00:00:14,180 So in this class, we are going to start working with Seabourne and we are going to create our first 4 00:00:14,180 --> 00:00:16,070 graph with this amazing, too. 5 00:00:16,370 --> 00:00:17,690 So he's going to first grab that. 6 00:00:17,690 --> 00:00:25,610 We are going to be of this blood, which consists of a histogram that is directly inside the well, 7 00:00:25,820 --> 00:00:30,410 which consists of a line that is directly inside of the histogram. 8 00:00:30,920 --> 00:00:32,570 So basically, you'll see it's pretty cool. 9 00:00:32,960 --> 00:00:34,000 So what exactly will do? 10 00:00:34,010 --> 00:00:34,750 It's pretty simple. 11 00:00:34,760 --> 00:00:42,170 We will, first of all, import a database or a dataset directly from the Internet, more precisely 12 00:00:42,170 --> 00:00:43,070 from GitHub. 13 00:00:43,490 --> 00:00:46,300 And we are going to work with those databases. 14 00:00:46,400 --> 00:00:51,790 For those of you who don't know where from where exactly, we'll import Irda will imported from here. 15 00:00:52,160 --> 00:00:57,440 So we see as you can see, this is GitHub and this is all the databases that you guys have. 16 00:00:57,440 --> 00:00:59,600 So basically there are plenty of those databases. 17 00:01:00,200 --> 00:01:03,680 So I'm going to show you how to import any of those databases. 18 00:01:04,100 --> 00:01:07,190 And we are going to work with the most simple ones. 19 00:01:07,280 --> 00:01:12,490 In this case, the most simple ones would be flight and in my opinion, tips. 20 00:01:12,540 --> 00:01:18,620 So basically, those are the two databases that are not really complicated and really interesting to 21 00:01:18,620 --> 00:01:18,960 work with. 22 00:01:19,430 --> 00:01:19,780 All right. 23 00:01:19,790 --> 00:01:21,810 So let's come back to our pie chart. 24 00:01:22,100 --> 00:01:26,330 So basically, the first thing to do would be to import everything right here. 25 00:01:26,330 --> 00:01:28,490 So everything has been imported. 26 00:01:28,700 --> 00:01:29,500 One less thing. 27 00:01:29,720 --> 00:01:30,060 Yes. 28 00:01:30,070 --> 00:01:34,950 So importing all the things that we need so we have no pipeline does matter. 29 00:01:36,080 --> 00:01:40,970 And finally, Seabourne, very important matplotlib not forget to write down that pipeline, because 30 00:01:40,970 --> 00:01:46,070 even if you don't write it down, you will not be able to work with all that blood. 31 00:01:47,090 --> 00:01:47,540 All right. 32 00:01:47,550 --> 00:01:51,260 So the first thing that will do is pretty simple is importing our databases. 33 00:01:51,680 --> 00:01:55,790 So we need to create a viable that we will call in our case database. 34 00:01:55,820 --> 00:01:57,500 So basically, I'm calling it database. 35 00:01:57,500 --> 00:01:59,350 You can call it whatever you want. 36 00:01:59,840 --> 00:02:03,020 So we'll create a variable that will be called database. 37 00:02:03,560 --> 00:02:03,950 All right. 38 00:02:04,310 --> 00:02:09,320 So when it's all done, the next thing that we'll do, we will use a function that will be referred 39 00:02:09,320 --> 00:02:10,220 to Seabourne. 40 00:02:10,220 --> 00:02:13,030 So we'll start what we will write with S.B. 41 00:02:13,460 --> 00:02:21,760 So we are making a reference to Seabourne in this case and we are going to ask Seabourne to load a dataset. 42 00:02:21,770 --> 00:02:28,430 So basically that data set in this case, we decide what data said that we want. 43 00:02:28,440 --> 00:02:30,290 So let's say we want to import diamonds. 44 00:02:30,410 --> 00:02:32,960 So this is one of the data sets that we have. 45 00:02:34,040 --> 00:02:36,170 So just to be sure, we can come back here. 46 00:02:36,590 --> 00:02:39,820 So we have a dataset that is called diamonds or diamonds. 47 00:02:39,830 --> 00:02:41,870 So this is exactly what we'll do right now. 48 00:02:42,170 --> 00:02:43,730 We'll import this data set. 49 00:02:44,000 --> 00:02:45,960 And just to be sure that everything works fine. 50 00:02:45,980 --> 00:02:47,120 What we'll do will printed. 51 00:02:47,120 --> 00:02:49,110 So to be able to see what it looks like. 52 00:02:49,550 --> 00:02:56,450 So we will print database, which is our this is our variable right here. 53 00:02:57,080 --> 00:02:59,360 So let's print it and see what it looks like. 54 00:03:02,760 --> 00:03:07,170 All right, so as you can see, everything works fine, so we have printed our database, our database 55 00:03:07,170 --> 00:03:07,670 works. 56 00:03:07,670 --> 00:03:08,520 So here we go. 57 00:03:08,520 --> 00:03:10,890 We have our Dimond's database. 58 00:03:11,220 --> 00:03:12,870 So this database is pretty huge. 59 00:03:12,870 --> 00:03:18,620 It's consisted of fifty three thousand nine hundred forty rows and ten columns. 60 00:03:18,630 --> 00:03:21,360 So this is a pretty big database. 61 00:03:21,840 --> 00:03:25,050 And the next thing that we want to do right now is pretty simple. 62 00:03:25,050 --> 00:03:27,670 We want to create our block or our graph. 63 00:03:27,810 --> 00:03:31,620 So for those of you who didn't understand what I just did, I imported the database. 64 00:03:31,980 --> 00:03:38,010 So here you have Dimond's, but you can change it by any other database that you want from this website 65 00:03:38,010 --> 00:03:38,460 right there. 66 00:03:38,880 --> 00:03:42,030 So pretty simple if you want to change it for dots, you can change it for dots. 67 00:03:42,030 --> 00:03:45,030 If you want to change it for you can change it for empty. 68 00:03:45,420 --> 00:03:51,060 And what it will do, it will simply import other databases so you can create your plots with any database 69 00:03:51,060 --> 00:03:52,050 that you guys want. 70 00:03:53,010 --> 00:03:53,340 All right. 71 00:03:53,350 --> 00:04:00,320 So for the next the next step, what we'll do, we will work with one of those variables right here. 72 00:04:00,330 --> 00:04:02,600 So I'm proposing to work with that. 73 00:04:02,670 --> 00:04:04,140 Carrots where price. 74 00:04:04,620 --> 00:04:06,650 So let's work with Chariot's. 75 00:04:07,050 --> 00:04:09,910 So what we'll do right now, we are going to create our blood. 76 00:04:10,410 --> 00:04:13,530 So once again, we are going to make a reference to Seabourne. 77 00:04:13,540 --> 00:04:14,610 So it's going to be S.B. 78 00:04:15,000 --> 00:04:18,890 And the type of blood that we are going to create will be the this plot. 79 00:04:19,590 --> 00:04:24,690 So basically we have this plot so that this plot will be referred to database. 80 00:04:24,700 --> 00:04:32,160 So basically we are going to take all our so we are going to take our information from database and 81 00:04:32,160 --> 00:04:33,870 then from what variable? 82 00:04:33,870 --> 00:04:36,750 From the Bible in this case, Charite. 83 00:04:37,290 --> 00:04:44,490 So we are referring everything to data base, so to the variable database and from the database. 84 00:04:44,490 --> 00:04:50,970 We want Python to look for Charite inside of this of this database right here. 85 00:04:52,140 --> 00:04:52,500 All right. 86 00:04:52,530 --> 00:04:54,900 So we will write down Carrott. 87 00:04:56,490 --> 00:05:02,050 So basically it will use those numbers that are right here to create the plot or the graph. 88 00:05:02,670 --> 00:05:03,040 All right. 89 00:05:03,060 --> 00:05:06,660 Next thing that we want to do is simply show everything to see what it looks like. 90 00:05:06,690 --> 00:05:11,980 So it's going to be PLT that show we can open up and close the parenthesis that we have. 91 00:05:12,810 --> 00:05:18,750 So this formula, will this function right here is just to show everything, this function right here, 92 00:05:19,170 --> 00:05:20,640 what it means, it's pretty simple. 93 00:05:21,090 --> 00:05:28,220 We are using dereference SB to be able to work with this blood function that is referred to Seabourne. 94 00:05:28,560 --> 00:05:32,220 And basically what this function does, it will ask database. 95 00:05:32,220 --> 00:05:34,470 So it will have a reference to database. 96 00:05:34,650 --> 00:05:40,590 So we are going to go to database and from database we want to extract the element. 97 00:05:40,590 --> 00:05:41,080 Charite. 98 00:05:41,220 --> 00:05:46,510 So basically in the database we have diamonds and from diamonds we we want to extract. 99 00:05:47,670 --> 00:05:50,160 Basically, when it's all done, you guys can run everything. 100 00:05:51,150 --> 00:05:54,480 So you'll have your database and finally you will have your plot right here. 101 00:05:54,780 --> 00:05:56,790 So you can see something that is pretty simple. 102 00:05:57,300 --> 00:06:02,350 You have your histogram and basically you have the line inside of the histogram. 103 00:06:02,820 --> 00:06:08,970 Once again, this is a bit complicated to understand, since it's well, we we are working with carats, 104 00:06:09,690 --> 00:06:12,960 but this is exactly what it will be generated. 105 00:06:12,970 --> 00:06:17,340 So this is what we will generate with our well, with this type of. 106 00:06:18,730 --> 00:06:23,530 So, yes, of course, sometimes we can have graphs that are specialized in some things, maybe this 107 00:06:23,530 --> 00:06:28,420 graph is not the best graph for for it to, you know, carrots, for example. 108 00:06:28,630 --> 00:06:32,750 Once again, this is a good way to show you guys what type of graph that you can generate. 109 00:06:33,220 --> 00:06:35,620 Next thing that you can do, you can add beans. 110 00:06:35,620 --> 00:06:43,180 Beans will simply add well, will simply tell you what is how big you want your histogram to be. 111 00:06:43,450 --> 00:06:45,310 So basically, it could be one. 112 00:06:45,310 --> 00:06:45,880 It could be two. 113 00:06:45,880 --> 00:06:46,470 It could be three. 114 00:06:46,470 --> 00:06:47,080 You could before. 115 00:06:47,920 --> 00:06:50,000 So you decide you will simply add it here. 116 00:06:50,020 --> 00:06:52,810 So basically inside of it you can add your beans. 117 00:06:53,170 --> 00:07:00,070 So if you simply write down beans and you write down the well how big you want your beans to be. 118 00:07:01,420 --> 00:07:03,040 So it's going to be just sheer. 119 00:07:06,130 --> 00:07:14,050 So we want to load this database and here we go, we want to have our bins and we decide how big one 120 00:07:14,050 --> 00:07:17,060 of them should be in this case, let's say we want to have bins of one. 121 00:07:17,380 --> 00:07:21,610 So this is how big we want our histogram to be and we can run everything. 122 00:07:23,140 --> 00:07:23,800 So here we go. 123 00:07:23,810 --> 00:07:28,060 As you can see, the bin size have changed and the histogram has changed. 124 00:07:28,360 --> 00:07:33,790 Once again, this is this is not a perfect example to do it with the carrots, for example, because 125 00:07:33,790 --> 00:07:35,590 once again, it doesn't give a grab. 126 00:07:35,590 --> 00:07:36,510 That makes a lot of sense. 127 00:07:37,060 --> 00:07:39,880 But once again, as you can see, this is how it works. 128 00:07:39,890 --> 00:07:43,510 So we see the bins is simply how big you want your histogram to be. 129 00:07:44,140 --> 00:07:45,970 So this is what you guys need to understand. 130 00:07:46,450 --> 00:07:47,350 So really important. 131 00:07:47,390 --> 00:07:50,790 You need to write it down right here was a bit lost earlier. 132 00:07:51,100 --> 00:07:52,960 So you write it down right there. 133 00:07:52,960 --> 00:07:58,000 So database and after the element that you guys want to extract from your database. 134 00:07:58,000 --> 00:07:59,790 So you write down your kids. 135 00:08:00,910 --> 00:08:01,310 All right. 136 00:08:01,780 --> 00:08:08,660 So I hope you guys right now understand what exactly you need to do to be able to create your this blog. 137 00:08:08,690 --> 00:08:11,500 So basically, your histogram with a line inside of it. 138 00:08:11,950 --> 00:08:14,860 And I hope you guys understand. 139 00:08:14,860 --> 00:08:18,460 Well, you can use it in any other way that you want. 140 00:08:18,760 --> 00:08:23,950 So if we want to simply do a little bit another thing that is pretty cool, so basically simply change 141 00:08:24,220 --> 00:08:28,420 databases so we can, for example, work with dots in this case. 142 00:08:28,420 --> 00:08:32,800 So let's choose dots and we run everything. 143 00:08:32,800 --> 00:08:35,050 So we'll simply take this away. 144 00:08:37,630 --> 00:08:38,200 So here we go. 145 00:08:38,200 --> 00:08:40,180 It's going to generate dots right here. 146 00:08:40,210 --> 00:08:41,230 So those are the dots. 147 00:08:41,230 --> 00:08:45,300 And what we can do right now, we can, for example, extract something else. 148 00:08:45,300 --> 00:08:48,700 So, for example, we want to extract the decoherence from our dots. 149 00:08:48,700 --> 00:08:52,100 We can do it so we can simply copy everything and pass it right here. 150 00:08:52,450 --> 00:08:56,230 So we want to extract clearance from the database dots. 151 00:08:56,500 --> 00:09:02,240 And if we run, everything, as you can see, will receive our chart right here. 152 00:09:02,260 --> 00:09:04,810 So basically, this would be our histogram inside. 153 00:09:04,890 --> 00:09:07,810 Well, this would be our histogram that will be generated. 154 00:09:07,820 --> 00:09:12,080 So you can see you can work with any database that you guys want from this website. 155 00:09:12,610 --> 00:09:16,360 So that's it, first class guys and see our next class.