WEBVTT

00:01.960 --> 00:07.120
In the last video we learned that being an adult male on the Titanic was a pretty bad combination for

00:07.120 --> 00:09.500
surviving the disaster.

00:09.520 --> 00:15.640
So now we want to check the opposite hypothesis and we know that there was a clear code of conduct to

00:15.640 --> 00:17.790
save women and children first.

00:17.800 --> 00:25.150
And what we want to do now is actually we want to check if being either a female or a child was favorable

00:25.150 --> 00:28.030
when it comes to surviving the disaster.

00:28.030 --> 00:34.950
So first of all we import pandas and we work with our Titanic data frame and we have actually two conditions

00:34.960 --> 00:41.130
so we want to check if we have a female and we store the residing panda serious of its boolean values

00:41.160 --> 00:51.430
and mask one and as a second condition we check whether the age of the peasants is less than 14 and

00:51.460 --> 00:54.070
we started this uh in uh mask 2.

00:55.900 --> 01:04.000
So now we have here two pandas serious with boolean values and now we want to combine both conditions

01:04.030 --> 01:05.490
with an ah operator.

01:05.500 --> 01:14.590
So we have to use here the pipes and the As are and the pipes symbol stands for the logic are so by

01:14.590 --> 01:20.920
combining mosque one and mosque two of us and the pipe symbol we should get all passengers that at least

01:20.920 --> 01:22.720
meet one condition.

01:22.720 --> 01:24.880
So we should get adult females.

01:24.880 --> 01:31.690
We should get young boys and at least one conditions means that we also should get all passengers that

01:31.690 --> 01:33.300
meet both conditions.

01:33.370 --> 01:40.260
So we also should get the guards below 4 9 year old so let's combine him mosque one and mosque two and

01:40.260 --> 01:44.570
let's have a look here so we get also here a boolean serious.

01:44.700 --> 01:50.120
So if you have a look at an exposition zero we have flaws or flaws.

01:50.430 --> 01:56.790
So no condition is met and we get a false and let's have a look at an exposition one where we have true

01:56.880 --> 01:57.750
or false.

01:57.780 --> 02:00.240
So at least one condition is met and we get a true

02:03.080 --> 02:06.280
so here we have no example where we have two times truly.

02:06.290 --> 02:10.130
So maybe let's increase year to 10 ten rows

02:15.550 --> 02:16.990
and that's still not enough here.

02:17.020 --> 02:18.100
Maybe 20 rows

02:21.830 --> 02:24.350
for I'm searching now a younger

02:32.330 --> 02:34.260
so he had an exposition 10.

02:34.520 --> 02:36.520
We have true for the female.

02:36.530 --> 02:37.960
So it's a female.

02:37.970 --> 02:42.460
And also we have a true for being younger than 14.

02:42.500 --> 02:44.360
So we have true or true.

02:44.360 --> 02:50.200
And this gets us by combining it with are the guests here.

02:50.210 --> 02:54.600
Also a true and now we can pass and the combined.

02:54.690 --> 03:00.870
We in series here to our Titanic data set and dialogue operator and by doing so we are filtering out

03:00.900 --> 03:03.240
all rows that meet at least one condition.

03:03.240 --> 03:04.500
So let's second here

03:08.170 --> 03:10.920
so here we are have adult females.

03:10.960 --> 03:14.590
Then we have a baby male adult females.

03:14.670 --> 03:18.810
Uh a very young female here a very young male here

03:21.830 --> 03:28.250
so we created a brand new data frame with only females and young boys.

03:28.280 --> 03:28.700
All right.

03:28.700 --> 03:35.870
So now we can further filter our data frame so we again use mass one or mosque two and we are only interested

03:35.870 --> 03:42.370
in the year survival column in The Passenger class sex and age so we are creating your a brand new data

03:42.370 --> 03:47.260
frame and we are starting the data frame here and the variable bundle not to run

03:50.540 --> 03:53.930
and let's check our new data frame the first five rows

03:56.930 --> 04:00.650
and let's get more information on our data frame here.

04:00.710 --> 04:08.750
So we have three hundred fifty one entries so we have 351 passengers that are either women or children

04:11.290 --> 04:19.420
and let's use them the described method to get even more information and we see here in the survived

04:19.450 --> 04:20.010
column.

04:20.020 --> 04:27.610
So we have a mean of 0 points 7 2 and that means with being either woman or child the probability of

04:27.610 --> 04:32.560
surviving the disaster was actually Seventy two percent and that's quite high actually.

04:32.550 --> 04:39.810
So we can also compare this to the survival rate of all passengers and we already know that this uh

04:39.940 --> 04:44.260
the survival rate of all passengers was only 38 percent.

04:44.650 --> 04:53.410
So actually our data set supports our hypothesis that being either a woman or a child was a very favorable

04:53.440 --> 04:59.360
characteristic on onboard of two titanic to survive from the disaster.

04:59.640 --> 05:00.000
All right.

05:00.000 --> 05:04.140
So now we are finished with this session and I hope to see you on the next one by.
