WEBVTT

1
00:00:00.720 --> 00:00:04.833
In our last challenge,
we explored the relationship between two

2
00:00:04.833 --> 00:00:09.060
quantitative variables,
level and attack points.

3
00:00:09.060 --> 00:00:13.322
It would be nice to know the distribution
of some variables with the histogram and

4
00:00:13.322 --> 00:00:14.960
a kernel density estimation.

5
00:00:16.450 --> 00:00:21.857
So what is the distribution of
attack points and defense points?

6
00:00:21.857 --> 00:00:27.240
Here's some hints,
use sns.histplot and sns.kdeplot.

7
00:00:29.260 --> 00:00:33.800
Make a histogram to find out
the distribution of attack points.

8
00:00:33.800 --> 00:00:38.648
You can also plot a kde curve over
the histogram by setting the kde keyword

9
00:00:38.648 --> 00:00:39.934
argument to true.

10
00:00:39.934 --> 00:00:44.559
Then use the kernel density estimation
plot to find the distribution of

11
00:00:44.559 --> 00:00:47.830
defense points as a probability curve.

12
00:00:47.830 --> 00:00:49.336
Pause me and try it out.

13
00:00:51.174 --> 00:00:51.960
How did it go?

14
00:00:53.230 --> 00:00:55.924
Here's how I solved these problems.

15
00:00:55.924 --> 00:01:03.398
For the histogram sns.histplot,

16
00:01:07.151 --> 00:01:10.765
(data = monsters,

17
00:01:10.765 --> 00:01:15.383
x= 'Attack_Points',

18
00:01:15.383 --> 00:01:18.608
and kde = True).

19
00:01:18.608 --> 00:01:24.176
Nice, for our histogram of attack
points it looks like most monsters

20
00:01:24.176 --> 00:01:29.270
have attack points distributed
between 750 and 1500.

21
00:01:29.270 --> 00:01:35.274
There are 10 observations between 750 and
1000 and

22
00:01:35.274 --> 00:01:40.463
10 observations between 1250 and 1500.

23
00:01:40.463 --> 00:01:44.130
That's about half of
the monsters in our collection.

24
00:01:46.220 --> 00:01:50.324
Now for the defense points,

25
00:01:50.324 --> 00:01:55.625
sns.histplot (data = monsters,

26
00:01:55.625 --> 00:01:59.733
x = 'Defense_Points',

27
00:02:04.101 --> 00:02:06.294
And kde = true).

28
00:02:09.030 --> 00:02:14.370
Nice, for our defense points
distribution it looks like most

29
00:02:14.370 --> 00:02:19.917
monsters have defense points
distributed between 1000 and

30
00:02:19.917 --> 00:02:24.129
2000 with 10 observations at 1000 and

31
00:02:24.129 --> 00:02:28.480
9 observations between 1500 and 2000.

32
00:02:28.480 --> 00:02:30.964
Awesome work so far, analysts.

33
00:02:30.964 --> 00:02:34.860
We're done with quantitative analysis.

34
00:02:34.860 --> 00:02:36.488
In the next challenges,

35
00:02:36.488 --> 00:02:41.420
we will move on to explore our
categorical variable attribute.

36
00:02:41.420 --> 00:02:42.400
I'll catch you there.
