00:00Hello everyone, in this video, we are going to talk about data monging in pandas part 5.
00:07First, we are going to talk about group 5.
00:14So, group 5, we have different classes in categorical data.
00:19So, based on the data class.
00:22For example, we have gender column.
00:26So, in titanic.group5 method, we are going to pass what column based on the group.
00:31So, gender.
00:32So, here are male and female data sets.
00:35So, here are female data sets.
00:39We are going to research the female data sets.
00:42Then, we are going to group the male data sets.
00:46If we are going to store a variable, G,
00:49we are going to visualize, G print when we are going to group 5 in particular memory location.
00:56Now, if we are going to group 5, we are going to park the result.
00:59First, we are going to use a for loop.
01:01So, in G, we have the data.
01:04Male.
01:05Male is 12 column details.
01:08Next, female.
01:09Add the female details.
01:11This is a form of double.
01:12This is a form of double, within list.
01:13This is a form of double.
01:14This is a form of double.
01:15Within list.
01:16Okay.
01:17So, this is a form of analyze.
01:18So, we have another way to analyze the date.
01:20First, for gender, data.
01:22Then, if we are going to group the gender,
01:24then, we will store the gender.
01:25And then, the particular data,
01:27we will store the data.
01:28Then, the first time we have run the data.
01:31Let's see how this column is going to group 6.
01:32Okay.
01:33If we are going to group 7,
01:35If we are going to group 8,
01:37Now, the first column is female.
01:39Let's press the print for gender.
01:42and the second column is going to group 7.
01:44Now, if we are going to group 8,
01:45next time we have to show the column.
01:47We will store the details here.
01:48Then, the second column shows the volume.
01:50So, in the first column is the profile column.
01:52Let's see how the confirmations are going to group 8.
01:55So, the first column column is to them.
01:57First,
01:58if we use a form of female,
02:00Gender column, that is, female data set up, female 12 columns show up.
02:06If we change gender, only females are the same.
02:10Next, male based on category.
02:17So, male, that is, print gender, show up.
02:20That is, male data set up.
02:23Direct, Titanic of, Titanic of gender equal to equal to male,
02:27we can analyze individual.
02:29We can analyze group.
02:31Next, this is individual.
02:33Titanic of, Titanic of gender equal to equal to male,
02:37we can extract group by.
02:39So, if we do specific category,
02:43one method is get group.
02:45So, g.get underscore group,
02:47male, we can extract group by.
02:51We can start by email.
02:53If we select group by,
02:55we click on the group by.
02:57We can select group by.
02:59You can select the group by variable,
03:01list.
03:03Then, we need female, female data.
03:04If we select male, male detail,
03:05we can link this list.
03:07This is the individual.
03:09So, the-key-key-key factor.
03:11Next, we use the procedure again.
03:13Next, we can select aggregate function,
03:16our result.
03:17We can select titanic.group by gender.
03:19group by gender to the director visualize
03:21we can do three ways
03:23we can do count
03:25aggregation function
03:27we can do director result
03:29for example aggregation function
03:31in the aggregation function
03:33count
03:35minimum
03:37maximum
03:39mean
03:41sub
03:43so this is what we say
03:45aggregation function
03:47count method
03:49group by
03:5112 columns
03:53female
03:55gender
03:57female male
03:59individual columns
04:01count value
04:03count value
04:05actually female
04:07314 females
04:09577 males
04:11so
04:13count value
04:15right
04:17number
04:1915
04:21number
04:23number
04:25number
04:27number
04:29number
04:31number
04:33punya
04:35number
04:37so we can use a function to apply
04:39so the category data
04:41this is the aggregation function
04:43we can support
04:45so in that case
04:47we can use
04:49specific
04:51numeric columns
04:53for example
04:55titanic.groupby
04:57gender
04:59female and male
05:01then we can use
05:03numeric columns
05:05titanic.select underscore details
05:07include equal to int float
05:09this is the column
05:11we can extract
05:13column name
05:15dot columns
05:17so this is the result
05:19provide
05:21gender based
05:23specific columns
05:25we can use the aggregation function
05:27mean, count, minimum, maximum
05:29this is the aggregation function
05:31dot aggregation of
05:33list
05:34and aggregation methods
05:35provide
05:36one column
05:37mean and count value
05:38apply
05:39show
05:40age
05:41mean
05:42value
05:43female
05:4427
05:45male
05:46category
05:47mean value
05:48age
05:49meaning
05:50we can use
05:51name
05:52we can use
05:53here
05:55that
05:56we can use
05:57gender
05:58based
05:59in the
06:01column
06:02we can use
06:03the aggregation function
06:04apply
06:05to the
06:06example
06:07age
06:08mean
06:09maximum
06:10Next, we need to add a column in the dictionary.
06:14Next, we need to add an aggregation function.
06:17Specifically, we need to add a different aggregation function.
06:21We need to add a survey column to the mean value.
06:24That means we need to provide a mean value.
06:30Next, we need to add two columns to the group.
06:34For example, we need to add age and gender.
06:42We need to add a specific survey and passenger column.
06:46That means we need to add a mean maximum count.
06:49So, we need to add a mean maximum count.
06:51In the passenger class, we need to add a mean maximum count value.
06:54Now, we need to show the first 15 rows.
06:58We need to show the first 15 rows.
07:01Now, the first priority is age.
07:04We need to add one year to the female category.
07:08We need to check the survey and passenger class.
07:10We need to check the female and male.
07:12This is the category.
07:13So, in the result, we need to add a group.
07:17We need to add a group.
07:19We need to add an index.
07:20That's the age.
07:21We need to add a table to the index.
07:24Then, we need to add a table to the index.
07:28That is, result.resetIndex.
07:31We need to add a table format to the normal table format.
07:33We show the index value.
07:35That is, 0, 1, 2, 3, 4, 5.
07:37If we add a group, we need to show the index.
07:39If we add a group, we need to add index.
07:42So, this is the result.
07:43Now, when we add a table for the analysis,
07:46we need to add a set index.
07:48We need to add a specific column index.
07:51We need to add a set index.
07:53So, in Titanic.set underscore index,
07:55we need to add a passengerid.
07:58We need to add a list.
08:01We have to add a list,
08:02and the column we have indexed, we will provide the passenger ID and change the passenger ID.
08:09This is set index.
08:16This is the data monging in pandas part 5.
Comments