1 00:00:00,372 --> 00:00:02,543 Great job getting set up. 2 00:00:02,543 --> 00:00:06,343 Now it's time to challenge you to make some scatter plots. 3 00:00:06,343 --> 00:00:10,956 What is the relationship between Level and Attack Points and 4 00:00:10,956 --> 00:00:13,043 Level and Defense Points? 5 00:00:13,043 --> 00:00:20,518 Bonus: use sns.relplot(kind='scatter') to solve one of these questions. 6 00:00:20,518 --> 00:00:24,661 The seaborn library has many functions to achieve the same plots. 7 00:00:24,661 --> 00:00:26,865 For each of the following challenges, 8 00:00:26,865 --> 00:00:30,630 I'll drop a bonus hint into which ones you can use. 9 00:00:30,630 --> 00:00:35,732 You can find all of these functions in the seaborn API documentation. 10 00:00:35,732 --> 00:00:38,102 Now it's time to take the challenge. 11 00:00:38,102 --> 00:00:41,944 Pause me and try it out on your own. 12 00:00:41,944 --> 00:00:46,685 What is the relationship between Level and Attack Points? 13 00:00:46,685 --> 00:00:50,019 To draw a scatterplot, 14 00:00:50,019 --> 00:00:57,192 we can call sns.scatterplot(data=monsters, 15 00:00:57,192 --> 00:01:03,374 x='Level', y='Attack Points'). 16 00:01:06,365 --> 00:01:10,889 Remember that these parameters can be found in 17 00:01:10,889 --> 00:01:16,342 the previous cell when we called monsters.head(). 18 00:01:16,342 --> 00:01:19,886 They are the headings to each of these columns. 19 00:01:22,532 --> 00:01:24,581 And it looks like I'll have a typo here. 20 00:01:24,581 --> 00:01:29,355 I need Attack_Points. 21 00:01:34,223 --> 00:01:39,914 Nice, there seems to be a general positive correlation between Level and 22 00:01:39,914 --> 00:01:41,211 Attack Points. 23 00:01:41,211 --> 00:01:46,402 As Level gets higher, so do Attack Points. 24 00:01:46,402 --> 00:01:48,433 How about for Defense Points? 25 00:01:48,433 --> 00:01:54,662 Let's do one with the bonus hint, sns.relplot. 26 00:01:54,662 --> 00:01:59,297 In Jupyter Lab, you can use the shift tab keyboard combo on a function to open 27 00:01:59,297 --> 00:02:04,383 the method signature documentation to get more information about that function. 28 00:02:04,383 --> 00:02:08,514 It looks like this function is set up similarly to 29 00:02:08,514 --> 00:02:13,369 the scatterplot function where we have data, x, and y. 30 00:02:15,513 --> 00:02:20,831 When I scroll down, there's documentation about what relplot is used for. 31 00:02:20,831 --> 00:02:24,151 Feel free to read through this. 32 00:02:24,151 --> 00:02:29,322 It's the same as what is in the seaborn API documentation from their website. 33 00:02:29,322 --> 00:02:33,262 Let's use this function, 34 00:02:33,262 --> 00:02:40,800 sns.relplot(data=monsters, x='Level', 35 00:02:40,800 --> 00:02:48,347 y='Defense_Points'), with an underscore. 36 00:02:52,873 --> 00:02:58,105 The default kind for the relplot is a scatter plot, 37 00:02:58,105 --> 00:03:03,714 but we can be explicit by setting kind='scatter'. 38 00:03:03,714 --> 00:03:05,931 Let's run the cell. 39 00:03:05,931 --> 00:03:09,487 And we've got a scatterplot that shows a general 40 00:03:09,487 --> 00:03:13,746 positive correlation between Level and Defense Points. 41 00:03:13,746 --> 00:03:20,213 Generally, as Level increases, so do the Defense Points. 42 00:03:20,213 --> 00:03:23,993 Awesome, are you ready for the next challenge? 43 00:03:23,993 --> 00:03:24,920 I'll catch you there.