WEBVTT

00:00.960 --> 00:06.400
In this video we are going to create our very first seaborne plot a so-called current plot.

00:06.510 --> 00:13.380
But before we need to import pandas and also seaborne and by convention the standard appreciation is

00:13.410 --> 00:20.500
s and s so we import seaborne S S and S and we also import met plot lip.

00:20.580 --> 00:24.090
And in this video we are working with the Titanic data frame.

00:24.090 --> 00:26.030
So let's also import this year.

00:26.190 --> 00:32.980
So we have the first five rows and now we want to create a seaborne Kong plot and early on this costs

00:33.000 --> 00:38.450
that we have seen that we can split our data into different groups by using categorical data.

00:38.910 --> 00:44.820
And we did this for example with the group by a method and with the group by method we were able to

00:44.820 --> 00:46.540
group our data out by a flight sample.

00:46.550 --> 00:49.830
The sex column into a female and male.

00:50.150 --> 00:56.550
All we also created the six groups by the category is sex and PE class and width of the group by method.

00:56.550 --> 01:00.600
We were also able to count the number of elements in each group.

01:00.630 --> 01:07.260
So for example the number of first class male passengers on board of the Titanic and exactly this we

01:07.260 --> 01:10.380
can do also with the the count plotted graphically.

01:11.220 --> 01:14.720
So first of 5 we set here the figure size 212 aid.

01:15.000 --> 01:18.830
And the final statement here with purity don't show.

01:18.840 --> 01:21.240
So this is nothing new.

01:21.340 --> 01:26.180
And now we want to create a conflict and we can do this with the S and S stopped count.

01:26.190 --> 01:30.000
Plot and let's have a look here inside the brackets.

01:30.300 --> 01:36.330
So the count plus shows of the Council of observations in each category they've been using boss and

01:36.330 --> 01:41.260
we have yes several pyramid does and the section of the seaborne plots are quite similar.

01:41.460 --> 01:44.170
So we always have fear the pyramid that data.

01:44.700 --> 01:48.180
And here we have to pass our data frame that we want to plot.

01:48.210 --> 01:51.030
So in this example Titanic.

01:51.030 --> 01:54.380
And then in addition we have 50 does X and Y.

01:54.580 --> 01:56.930
And here we have to pass of on column.

01:57.330 --> 02:03.470
So for example let's assume that we want to count the amount of female and the amount of males on board

02:03.480 --> 02:04.530
of the Titanic.

02:04.530 --> 02:10.990
Then we pass it to the parameter X our column Sex here in quotation marks.

02:11.010 --> 02:18.250
So let's say running in the center and we can actually see a bar chart maybe a few on the left hand

02:18.250 --> 02:20.230
side the amount of males.

02:20.260 --> 02:26.680
So it's about five hundred seventy and the number of females on board of the Titanic.

02:26.680 --> 02:29.230
So about the three hundred twenty something.

02:29.650 --> 02:31.780
So this is the vertical column plot.

02:31.810 --> 02:36.270
But we can also pass the sixth column to the Via pairing meter.

02:36.850 --> 02:40.930
And now we have the same chart horizontally.

02:40.930 --> 02:48.760
So let's go back to the vertical graph and actually the very powerful thing with the seaborne this that

02:48.850 --> 02:52.870
we can further split here our data into subgroups.

02:52.870 --> 02:58.990
So for example here we can split up the bin father made peasant just into a first class second class

02:58.990 --> 03:06.370
and third class bin and we can do the same with the female had been here and this the very powerful

03:06.370 --> 03:07.730
pyramid the hue.

03:07.870 --> 03:14.310
And we can find this parameter in many seaborne plots so let's have a look here.

03:14.350 --> 03:17.020
So here we have the parameter hue.

03:17.290 --> 03:20.530
And here we can pass a column with the categorical data.

03:20.860 --> 03:25.510
So in our example we could pass here for example the peak class column

03:28.960 --> 03:29.740
and the.

03:29.800 --> 03:30.520
Let's have a look.

03:30.520 --> 03:31.510
What do we get here.

03:33.220 --> 03:39.900
So here we actually split up our male been in our female bin in two uh three separate bins.

03:39.970 --> 03:47.410
So we have in total about 120 first class male peasants us then we have an orange for male and female.

03:47.410 --> 03:53.240
The second class peasant passengers and in green the third class passengers.

03:53.410 --> 03:55.060
So here we have our sixth group.

03:55.060 --> 04:01.600
And for each group we have the number of passengers which belong to their respective group and we can

04:01.600 --> 04:06.370
also customize and the change the style of symbol on plots.

04:06.700 --> 04:07.880
And we can do this here.

04:07.900 --> 04:11.140
This is an S thought to set.

04:12.190 --> 04:13.410
So let's have a look here.

04:14.940 --> 04:18.630
And the Tessier said a static pair meet us in one step.

04:18.630 --> 04:22.850
So for example here we can change the fun skater.

04:22.890 --> 04:24.240
Let's try this out here.

04:24.420 --> 04:31.410
So with this actually we can make the font size here on the x and y axis and on the let's and larger.

04:31.440 --> 04:39.940
So for example let's pass here to and now we have a significantly larger font size.

04:39.940 --> 04:47.420
And for example we can also have some other changes here so we can change the fund itself.

04:47.530 --> 04:52.440
Well we can also change the color map so when that plot slip we know this as color map.

04:52.480 --> 04:54.730
Here we have the pyramid palette.

04:54.790 --> 05:03.680
And for example let's call this perimeter here and that's pass the color map of it yes.

05:04.030 --> 05:07.060
And by doing so we can change here the color style.

05:07.930 --> 05:10.740
And actually many more options to customize the yellow graph.

05:10.760 --> 05:17.750
So feel free to have a look at the map plot lib and also that the Seabourn documentation and.

05:17.910 --> 05:23.320
For the time being while we are finished with this the first video and out to see you also in the next

05:23.320 --> 05:24.370
videos by.
