1 00:00:00,420 --> 00:00:02,010 All righty then. 2 00:00:02,010 --> 00:00:07,800 So in the past few section we've been looking at data in the form of lists of numbers and arrays and 3 00:00:07,800 --> 00:00:08,870 data frames. 4 00:00:08,970 --> 00:00:13,340 But in this section we're going to start looking into matte plot lib. 5 00:00:13,580 --> 00:00:19,290 And so the first question may have and so fairly good question to have is what is map plot lib. 6 00:00:19,290 --> 00:00:24,570 Well as you might have inferred by the name it's a plotting library more specifically a python plotting 7 00:00:24,570 --> 00:00:25,230 library. 8 00:00:25,350 --> 00:00:31,260 So it'll fit in with what we've been using before and what map plot lib does is it allows us to turn 9 00:00:31,260 --> 00:00:37,060 our data into some pretty visualizations also known as plots or figures. 10 00:00:37,710 --> 00:00:43,580 So let's get started to refer back to our machine learning modeling framework. 11 00:00:43,580 --> 00:00:49,310 We go through Problem Definition Data Evaluation features modelling experiments. 12 00:00:49,310 --> 00:00:55,550 Then if we go back to where our tools fit in We're going to be covering that plot lib which is a part 13 00:00:55,550 --> 00:01:00,830 of the data analysis section but can also as you'll see with all of these tools can also be part of 14 00:01:00,830 --> 00:01:04,130 the experiment section we'll get to that in a future video don't you worry. 15 00:01:04,970 --> 00:01:09,950 But this is going to complete the trifecta of pandas num pi and map plot lib. 16 00:01:09,950 --> 00:01:12,960 And once you start to see these three in action it really makes sense. 17 00:01:12,970 --> 00:01:20,740 The synergy these three provide in doing data analysis and exploring different datasets so why map what 18 00:01:20,740 --> 00:01:21,640 lib. 19 00:01:21,640 --> 00:01:25,660 Well first of all it's built on an umpire res and Python. 20 00:01:25,870 --> 00:01:31,540 As we've discussed before a lot of data and numerical information are built upon num player res including 21 00:01:31,540 --> 00:01:37,480 panders data frames and it's the same with map plot lib and because all of this is written in Python. 22 00:01:37,480 --> 00:01:39,460 We won't have to learn another coding language. 23 00:01:39,580 --> 00:01:45,790 So now we can work with our data and create visualizations as you'll see shortly with the same coding 24 00:01:45,790 --> 00:01:46,740 language. 25 00:01:47,170 --> 00:01:51,480 It integrates directly with pandas through the map plot led pandas API. 26 00:01:51,760 --> 00:01:54,330 You can create basic or advanced plots. 27 00:01:54,490 --> 00:01:59,830 And again like the other libraries write map plot lib if you can imagine a visualization if you can 28 00:01:59,830 --> 00:02:05,860 imagine a plot you can probably create it using map plot lib but we're going to be focused on the most 29 00:02:05,860 --> 00:02:07,590 useful types of plots. 30 00:02:07,840 --> 00:02:10,060 And it has a simple to use interface. 31 00:02:10,060 --> 00:02:12,240 Of course once you get the foundations. 32 00:02:12,310 --> 00:02:17,830 But that's what we'll be covering what are we going to cover. 33 00:02:17,830 --> 00:02:21,940 Well it's a little bit of a workflow that happens within map plot lib. 34 00:02:21,940 --> 00:02:28,240 You start with the data you create a plot also known as a figure which is kind of just like an empty 35 00:02:28,240 --> 00:02:29,460 square really. 36 00:02:29,500 --> 00:02:33,790 And then number three is you plot data accesses on figure. 37 00:02:33,820 --> 00:02:38,050 So there are the two main data classes of map plot lib access and figure. 38 00:02:38,080 --> 00:02:39,940 But we'll look into these shortly. 39 00:02:39,940 --> 00:02:45,640 And so once you've plotted some data you'll have something that looks like this in X and a Y axis with 40 00:02:45,640 --> 00:02:47,800 some information on here. 41 00:02:47,800 --> 00:02:52,540 Then you can customize the plot and add in something like a little bit of a title here and add another 42 00:02:52,540 --> 00:02:59,110 title here and a title here so in this case you've got the 0 2 mastery machine learning and over time 43 00:02:59,320 --> 00:03:01,570 your email knowledge is increasing. 44 00:03:01,630 --> 00:03:02,720 Well that sounds great. 45 00:03:02,740 --> 00:03:05,010 That's kind of similar to what we're doing now. 46 00:03:05,110 --> 00:03:10,810 And then finally you'll save or share the plot because as you could imagine looking at a big table of 47 00:03:10,810 --> 00:03:14,380 data full of numbers they can get quite confusing. 48 00:03:14,440 --> 00:03:16,240 Humans were visual creatures right. 49 00:03:16,240 --> 00:03:17,830 We want to see things visually. 50 00:03:18,040 --> 00:03:23,230 So that's where these plots come in handy so you can save or share them to visually communicate your 51 00:03:23,230 --> 00:03:30,380 work rather than just having it in a table full of numbers so more specifically once we've gone through 52 00:03:30,380 --> 00:03:35,120 the map plot lib workflow we're going to use that workflow throughout all of these little dot points 53 00:03:35,120 --> 00:03:35,720 here. 54 00:03:35,750 --> 00:03:39,700 We'll focus on importing that port lib and see the two different ways of plotting. 55 00:03:39,940 --> 00:03:44,570 Yeah I know there's two different ways but when I look at them both and then we're going to pick the 56 00:03:44,570 --> 00:03:47,510 one that is most useful the most adaptable. 57 00:03:47,680 --> 00:03:53,060 I'm going to plot data directly from num pi arrays so that'll build upon the NUM pi section and then 58 00:03:53,060 --> 00:03:57,590 we'll look at our map plot lib integrates directly with Panda's data frames through the map plot lib 59 00:03:57,590 --> 00:04:02,360 pan is API and we'll have a look at customizing our plots so adding a different color. 60 00:04:02,450 --> 00:04:07,610 Putting in some different titles naming our things what we want and then finally we'll finish up the 61 00:04:07,610 --> 00:04:14,640 workflow by saving and sharing our plots so we can communicate our work with others. 62 00:04:14,790 --> 00:04:17,220 Now where can you get help. 63 00:04:17,310 --> 00:04:22,350 The first step is to always follow along with the code if you can remember our motto. 64 00:04:22,350 --> 00:04:26,990 If in doubt run the code so we'll be going again through another Jupiter notebook. 65 00:04:27,030 --> 00:04:33,160 It'll be available for you to go through at the end of the session or in their extra information section. 66 00:04:33,210 --> 00:04:35,000 Always try it for yourself. 67 00:04:35,100 --> 00:04:37,830 If in doubt run the code try another thing. 68 00:04:37,830 --> 00:04:39,030 Keep going. 69 00:04:39,030 --> 00:04:40,180 If you're still stuck. 70 00:04:40,200 --> 00:04:40,900 Search for it. 71 00:04:40,920 --> 00:04:42,840 You'll probably come up against Stack Overflow. 72 00:04:42,840 --> 00:04:48,150 We've seen that in the past or the map plot lib documentation which again is very vast. 73 00:04:48,180 --> 00:04:53,640 So if you have a specific problem you might try search for it first and then read through the documentation 74 00:04:53,640 --> 00:04:56,570 if you don't really understand what's on Stack Overflow. 75 00:04:56,610 --> 00:04:57,840 Try again. 76 00:04:57,960 --> 00:05:00,630 And then finally ask a question. 77 00:05:00,630 --> 00:05:07,380 Remember if in doubt run the code I have to keep reminding myself of this too you know all right. 78 00:05:07,800 --> 00:05:12,080 Well if you're ready to plot give me a wife. 79 00:05:12,470 --> 00:05:14,860 I'll start with the jokes now. 80 00:05:14,880 --> 00:05:16,320 I'll see you in the next video.