WEBVTT

00:01.110 --> 00:06.960
In this video we learn how to create a customized set of as statistics for a data frame and with only

00:06.960 --> 00:12.870
one line of code and we can also calculate different summaries that are 6 4 different columns of our

00:12.870 --> 00:20.110
data frame and this we can do actually with the EC method first of all we import pen us as always.

00:20.250 --> 00:25.630
Then we are working with the Titanic data frame and we've already learned that.

00:25.710 --> 00:31.530
We can calculate and get the many summary statistics with the describe method.

00:31.530 --> 00:37.830
So here we have a mean standard deviation min max and so on and we can also calculate one of these the

00:37.920 --> 00:41.730
summary statistics separately with the respective method.

00:41.730 --> 00:47.590
So for example we can calculate the mean for all the columns and width of the act method.

00:47.610 --> 00:53.190
We can actually customize the set of summary statistics that we want to calculate for our data frame

00:53.760 --> 00:59.180
and we use the Act method here on our Titanic data frame and within the parents uses.

00:59.250 --> 01:05.210
We pass here the aggregation functions at a string so for example the mean method here.

01:05.250 --> 01:11.820
Within quotation marks and this gives us the actually the same result as here.

01:11.940 --> 01:19.820
The mean method itself but as I said to the real power of the act method is that we can combine different

01:19.810 --> 01:27.810
summaries such as Six and therefore we have to pass it to the ACT method a list of summaries statistics.

01:27.960 --> 01:34.980
So in this example of the mean and standard deviation and then we are getting here the mean and the

01:34.980 --> 01:38.280
standard deviation for all in the marital columns.

01:38.280 --> 01:43.890
And of course so that even more summary statistics that we can include to our list.

01:43.890 --> 01:51.930
So for example min max and median and we can also add some num pi universal functions or we can also

01:51.930 --> 01:56.080
pass here a user defined function that we create.

01:56.340 --> 01:59.100
But this is yet beyond the scope actually.

01:59.160 --> 02:01.680
And finally we can even be more specific.

02:01.800 --> 02:10.200
So let's assume that for these survived column we are only interested in the mean and in the H column

02:10.200 --> 02:16.860
we are interested in the minimum and the maximum then instead of passing a list to the ACT method you

02:16.860 --> 02:19.440
can also pass a dictionary.

02:19.440 --> 02:24.730
And here we have a key value pass and as key we need.

02:24.960 --> 02:30.870
The column labeled so for example here these survived column and s value.

02:30.870 --> 02:37.320
We have to pass our desire to summarize statistics so for example here the mean and for the H column

02:37.350 --> 02:43.040
we are interested in the minimum and the maximum and therefore the key value pair is here.

02:43.050 --> 02:52.920
H and S value we have a list with our two summary statistics min and max so let's have a look and here

02:52.980 --> 02:55.790
our survival column we have only the mean.

02:56.130 --> 03:03.450
So we have any n values for the maximum at the minimum and the for the H column we have here the maximum

03:03.450 --> 03:04.620
and the minimum.

03:04.620 --> 03:07.760
So this is all you need to know about the act method.

03:07.890 --> 03:15.640
A pretty useful and helpful method if you ask B and if you want to work with the financial data varied

03:15.690 --> 03:23.850
is very often the case that the UK collate the mean and the standard deviation of returns and with this

03:23.850 --> 03:27.090
we are finished here and I hope to see also in the next video by.
