Icon

14_​Pivoting - Solution

14_Pivoting - Solution
Exercise Pivoting1) Read data adult_binned.csv available in the "data" folder2) Calculate the number of people in groups according to their work class and age bins- What is the most common combination of age bin and work class?- How many people belong to this group?3) Add income to the grouping columns, and take a look at the income class of the people inthe biggest group you calculated in the previous step. Do most of them earn more or less than50K per year?4) Remove “income” from the grouping columns again and change the aggregation method- What is the most widespread education level according to age bin and work class?- In which work classes is the most widespread education level of the youngest bin higherthan the education of the oldest bin? Out of 10936 people, 1094 earnmore than 50K and 9842 earn lessthan 50K. The most widespread educationlevel is number 9 (HS-grad). Forthe work classes "Federal-gov","Local-gov", and "State-gov", themost widespread education levelis higher for the youngest than theoldest age bin. The most common combination ofage bin and work class is 34 orless years old and Private. 10936people belong to this group. Create the table with age-bin as a groupand workclass as a pivot and calculatethe number of people in groupsRead data adult_binned.csvCreate the table with age-bin and income asgroups and workclass as a pivot andcalculate the number of people in groupsCreate the table with age-bin as a group and workclass as a pivot and find the mostwidespread level of education for each group Pivoting File Reader Pivoting Pivoting Exercise Pivoting1) Read data adult_binned.csv available in the "data" folder2) Calculate the number of people in groups according to their work class and age bins- What is the most common combination of age bin and work class?- How many people belong to this group?3) Add income to the grouping columns, and take a look at the income class of the people inthe biggest group you calculated in the previous step. Do most of them earn more or less than50K per year?4) Remove “income” from the grouping columns again and change the aggregation method- What is the most widespread education level according to age bin and work class?- In which work classes is the most widespread education level of the youngest bin higherthan the education of the oldest bin? Out of 10936 people, 1094 earnmore than 50K and 9842 earn lessthan 50K. The most widespread educationlevel is number 9 (HS-grad). Forthe work classes "Federal-gov","Local-gov", and "State-gov", themost widespread education levelis higher for the youngest than theoldest age bin. The most common combination ofage bin and work class is 34 orless years old and Private. 10936people belong to this group. Create the table with age-bin as a groupand workclass as a pivot and calculatethe number of people in groupsRead data adult_binned.csvCreate the table with age-bin and income asgroups and workclass as a pivot andcalculate the number of people in groupsCreate the table with age-bin as a group and workclass as a pivot and find the mostwidespread level of education for each group Pivoting File Reader Pivoting Pivoting

Nodes

Extensions

Links