WEBVTT

00:00.740 --> 00:01.630
Hi everyone.

00:01.640 --> 00:07.670
So in this video we will have our very first look at the data type or class pendency serious and pendency

00:07.730 --> 00:15.440
areas are one dimensional labeled arrays that have specific attributes and methods to deal with readable

00:15.500 --> 00:15.950
data.

00:15.950 --> 00:20.210
So for sample data with the missing values and so on.

00:20.210 --> 00:22.670
So but first of all let's impart pandas.

00:22.670 --> 00:31.940
And we also import umpires and P and we import our Titanic data set and we will have a look at the first

00:31.940 --> 00:34.130
five froze.

00:34.460 --> 00:36.450
So each row is a peasant.

00:36.490 --> 00:40.310
And each column is a characteristic of the passenger.

00:40.310 --> 00:49.000
And we can also have a deeper look with the info method so here we can see that we have eight hundred

00:49.000 --> 00:50.000
ninety one rows.

00:50.000 --> 00:56.240
So we have eight hundred ninety one passengers and we have nine columns survived passenger class six

00:56.290 --> 01:05.610
H is the best P parts fair embarked and deck and in the H column we have some missing values and also

01:05.620 --> 01:12.810
in that that column we have many missing values and actually we can create a panda serious from a data

01:12.810 --> 01:20.840
frame by selecting one column of a data frame and we can do this by passing the label of the column.

01:20.840 --> 01:25.930
So for example H am within the spritz BAP brackets here.

01:26.290 --> 01:33.750
So now we should get here to the H column of our Titanic data frame so here we can see we have a one

01:33.750 --> 01:39.970
dimensional array so here we have only one array with the values so one array of one column.

01:40.170 --> 01:48.040
And still we have them the labels here on the left side of our data frame and the order of the rosiest

01:48.100 --> 01:55.570
actually is still the same as in our original data frame and we can also check here that the data type

01:55.570 --> 02:01.350
of our sliced columns so we check here with the function type the data type of our slice.

02:01.350 --> 02:09.460
The column here and here it's a pen that serious and we already learned to turn into so to select a

02:09.460 --> 02:10.030
column.

02:10.030 --> 02:15.790
So the first alternative is by passing the column labeled within this paper brackets.

02:15.790 --> 02:22.750
So like here I'll we use using the column label as the attribute of the data frame so titanic thought

02:22.800 --> 02:23.220
H.

02:23.250 --> 02:26.340
So that's the attribute uh for for each column.

02:26.350 --> 02:27.790
Also for H.

02:27.820 --> 02:34.450
And we can get them the column essay penned as serious by using the attribute notation here and we can

02:34.450 --> 02:40.420
check give them both alternatives are the same with the method equal so we check if getting the H column

02:40.420 --> 02:46.180
with them this notation isn't the same as that with this notation and it should be a true.

02:46.180 --> 02:47.620
Exactly.

02:47.680 --> 02:57.460
And now we can assign a variable to our column and safe our column in the variable H so h is now our

02:57.460 --> 03:01.710
panacea is and penned our series and data friends share.

03:01.720 --> 03:07.510
Actually most of the attributes and methods however there are some attributes and some methods some

03:07.510 --> 03:11.170
that only work with the data frames and the other way around.

03:11.380 --> 03:16.310
There are some attributes and methods that only exists for pandas serious.

03:16.480 --> 03:22.690
And first of all we can check if the method Hap also works for a panda serious here our serious age

03:24.280 --> 03:32.650
and this is true or had also gifts last year the first five values are to say Rose and by default it's

03:32.740 --> 03:33.670
in the first five.

03:33.700 --> 03:43.390
But let's take your shift tab so we can change and here to let's say uh 2 and then we get the first

03:43.660 --> 03:52.760
two values here and the total method consequently works also with pandas series so we get by default

03:52.760 --> 04:00.020
the last five values are rows and with the D type attribute we can also check them the data type of

04:00.020 --> 04:06.320
our values here in our pandas serious so it should be here um in a float object actually because we

04:06.420 --> 04:16.730
fear one peasant was twenty seven point 0 years so it should be a float and this is true and let's try.

04:16.730 --> 04:22.400
Also the info method and TV get an error message.

04:22.400 --> 04:25.060
A serious object has no attribute info.

04:25.190 --> 04:32.440
OK and we can also try the shape attribute and we get that.

04:32.660 --> 04:39.740
We have here a one dimensional array with eight hundred ninety one elements and we can also pass a panda

04:39.740 --> 04:47.750
serious to a Python build and function like the length function and the length function returns us here

04:47.780 --> 04:54.350
the number or the amount of elements in our pandas serious are the amount of rows in our original data

04:54.350 --> 05:00.010
frame actually and we can also check for the index.

05:00.010 --> 05:06.630
So we have a range in next starting from zero to eight hundred ninety one excluding with step 1.

05:06.640 --> 05:09.250
So we can check also here on the left side.

05:09.400 --> 05:12.340
So we have a range index starting from zero

05:15.400 --> 05:19.030
and last but not least we can also try the describe method

05:21.870 --> 05:27.870
and here we get for our pandas series very interesting and head for summary statistics so we get here

05:27.870 --> 05:28.710
count.

05:28.710 --> 05:33.960
So this is the amount of number our values and ours spend serious.

05:33.990 --> 05:41.220
So obviously we have here one hundred seventy seven missing values in our series we have for the mean

05:41.220 --> 05:42.060
of our values.

05:42.060 --> 05:42.930
So twenty nine.

05:42.930 --> 05:50.520
So the average age on the Titanic was twenty nine years old and the standard deviation of our age and

05:50.580 --> 05:51.570
the minimum age.

05:51.570 --> 05:56.820
So the youngest passenger on board was only 0 point forty two years old.

05:56.820 --> 06:01.340
So a baby and we get to the 25th person tire.

06:01.350 --> 06:02.940
The fifth person tied.

06:03.300 --> 06:08.160
So the fifth person title is actually the median and it's 28 years.

06:08.190 --> 06:15.270
So actually 50 percent on board of the Titanic was younger than twenty eight and 50 percent of the passengers

06:15.270 --> 06:17.900
were older than 28 years old.

06:18.120 --> 06:23.370
And also we have here the seventy fifth person tile and the max.

06:23.370 --> 06:29.010
So the oldest passenger on board of the Titanic was 80 years old.

06:29.030 --> 06:29.380
All right.

06:29.390 --> 06:35.270
So this uh the first steps with pen that serious and the next session we will have a look at the numerical

06:35.270 --> 06:42.130
serious them that contain either into just off load objects and we try to analyze them these serious

06:42.320 --> 06:44.390
so hope to see you there by.
