Hello. In this lesson, we're going to bring it all together. Our customer has described to us that they have these five machines named ABCD and E. All right. This manufacturer has no visual representation of the production process or capabilities. Just none whatsoever. Our objective to create visuals of the process. All Right. Each machine has a specific rate of parts per hour, which we will also put into a python list. Now notice that our rate does need there needs to be five of these and there are five of these. Each machine operates this number of hours on a daily basis. And again, this is all respective. So, in other words, this 12 hours is with respect to a this 14 hours of operational capability per day is with respect to b and so on. Each machine has a switch over time in hours. And that means between parts, they need 2 hours in the case of machine A or 4 hours in the case of machine E to switch over. Each machine has a schedule. A part to manufacture and a number to produce. And what we're going to do is put that into a tuple. We do have five machines. So here's Our first kind of a nice big Python operation. We're going to create a schedule for each of our machines, and we're going to see that with a product schedule. So in the case of the A machine it's scheduled to make part A, B and C and it would make 500 856 hundred again, respectively. So part A, 500. Part B, 850. Part C, 600. The B machine is going to make part C, D, and E. The C machine would make parts A, B and C. The D machine would make de. And A, the E machine would make a B and C. And here's the respective counts. Now. What are we doing here? We're actually just taking the requirements of the business. The business has these five machines. The business needs to create these three parts. And all we're really doing is taking python and molding it to the business. Now. We love Pandas. We love data frames. So guess what? This does this. By using a Pandas data frame option or control, we can just simply point it to our A schedule and push that into a data frame. That's very handy for us. And that's what we want to do in this command right here, this series of commands. Now, what does that also imply? Well, we got five of these. We got to do this five times. So we're going to create these five data frames. Each of those data frames is going to have the schedule. So we're seeding each of those. All Right. Now, what we have to do next is we need to put the machine rate in there. Because the machine A produces 40 parts per hour. Machine B can Only produce 20 Parts Per hour. Machine C, yet a different rate. So we have to take that into consideration in order to properly calculate how long it will take. So let's add a new column for the machine rate. And let's just grab that from this list right here. And you can see that we just alter it through and we pump that data into our data frame. And now what we're doing, too, we started off by creating a tuple, pushed it into a data frame. Now we're energizing that data frame by adding new columns. Let's add another column for switch over and another one for operational hours. And again, the reason we would do that is to take into consideration how long that machine runs per day in order to figure out how long the elapsed time of that run is going to be. All right, let's add a couple more columns and we'll start taking a look at this data. Let's add a column for production time. And this is our first calculation field. So what we're going to do here is we're going to again, everything done times five, because we have these five different machines and we have this schedule for each of these machines. And so what we're going to do here is we're going to insert prod time as a ratio of the count divided by the rate. Well, if you have to produce 500 parts and it produces 500 parts per hour, then that would equal 1 hour of production in how we would want to do the math. So we do that for all of these parts. That gives us the ability to calculate raw production time, which would be this plus switch over. So that adds this field. Now, the final field we can create is a lapsed production time, which is a ratio of how long that machine runs per day, or how long it takes to produce that against the ratio of how long it runs in a 24 hours day. Let's go ahead and just print off the data frame. And it's just the first one, data frame A. And let's run this code right here. Take a look at this. All right, here's our data frame. Yay. And look what we have. We have done all these calculations. We started off, if you remember, we started off with the schedule. All right. And that was it. We started off with on machine A, which is what we're going to look at a, B and C for 500, 856 hundred. So let's take a look at what we got here. Yes, look at the original count. Product A, 500. Product b 850. Product C, 600. Machine rate, 40. Now, does that make sense? Well, let's look at the machine rate on this and we'll find out. We go back up to the original here. Yes, the machine rate for machine A is 40. So that would make sense. All right, it has calculated the production time, the raw production time, which would be the switch over plus production time, 14 and a half hours. That's perfect. And then a lapse time would be taking into consideration that this only runs 12 hours a day. So in this case, they're going to have to have 30 hours of elapsed time to account for the half the time they're not running. And in this case, the product would take 29 hours to create 46, followed by this product at 46 hours, and this third product at 34 hours. So way close enough to graph this. Let's take a look. And basically we're just going to say, hey, the data is ready. We'll point it to the data frame DFA and let's plot this and see what we got. And I like it. Look at this. So right out of the gate, a couple of lines of code. And we can see that we've got our variables. It stacked them because we asked it to do that. And this is really just a first chart just to make sure everything's working and operational and looks great. But we do need to dig in now, and we have a framework from which we can dig in. So notice now our data frame has all these basically answers. It allows us to do all kinds of cool stuff like this. Suppose we wanted to make another chart off of this and a subset. In other words, we want to make now the X axis on this to be product and the Y to be Elapsed production time. So let's run that and we'll notice that we get a different looking graph that compares the Elapsed production time by product. So here's product A, B and C. Let's do the next one here and take a look at another ratio on this where we are now taking the product and comparing it to the production time over here. And do this one here. Let's look at the raw production time by product. So we'll run that. And basically what you should observe on this is that now that we have this data set up, we can do all kinds of different charting to understand if our production process is operating the way it should. All right, that concludes this lesson. Next lesson, we're going to look at making decisions with heat maps. Thank you.