question archive Question 3) Create a table that contains the average age of workers in each 'sector'

Question 3) Create a table that contains the average age of workers in each 'sector'

Subject:Computer SciencePrice: Bought3

Question 3) Create a table that contains the average age of workers in each 'sector'. Column names for this table should be sector and "averageiage". Assign this table to q3 . q3 = ... q3 Question 4: Create a table that contains the average age of workers broken down by union and sector. A row of the table should be the average age for each sector of a particular union status. So, different union statuses should be rows, and different sectors should be columns. Assign this table to q4 . q4 = ... q4 Question 5: Create a new table called CP585_new , similar to the original CPSBS, except where the the values for the union variable are not_i n_union , and in_union _ CP585_new = .. . CP585_new Question 6: Write a function that will create a bar plot of the mean of a numerical variable for each sector arranged in order of sectors with the highest to lowest mean. Use the function to create a bar plot of the average years of education for each sector. Question 7: Create a histogram of experiences by 5 year increments from 0 to the maximum years of experiences(include the maximum years of experience).

1. Setup Run the two cells below to load the packages and data necessary for this exam. The dataset CPS85 contains data on 534 individuals surveyed in the year 1985. wage = The hourly wage educ = years of education white/hispanic = white or not/hispanic or not sex = sex (male or female) sout = whether or not the person was from the south exper = years of experience union = whehter or not the person was in a union age = age in years sector = what sector the person works in In [1]: from datascience import * import numpy as np import matplotlib %matplotlib inline In [2]: CPS85 = Table. read_table("CPS85. csv") CPS85 Out [2 ] : wage educ white/hispanic sex south married exper union age sector $9.00 10 W/NH M NS Married 27 Not 43 const $5.50 12 W/NH M NS Married Not 38 sales $3.80 12 W/NH F NS Single 4 Not 22 sales $10.50 12 W/NH F NS Married 29 Not 47 clerical $15.00 W/NH M NS Married 10 Union 58 const $9.00 16 W/NH F NS Married 27 Not 49 clerical $9.57 12 W/NH NS Married 5 Union 23 service $15.00 14 W/NH M NS Single 22 Not 42 sales $11.00 W/NH M NS Married 12 Not 56 manuf $5.00 12 W/NH F NS 14 Not 32 sales . (524 rows omitted) Question 1: Compute the absolute difference of average years of education between men and women, round the result to 2 decimal places. Assign this value to q1 . In [ ]: 91 = Question 2: Create a table with the 6 youngest workers who have more that 5 years of experience. Assign this table to q2 . In [ ]: 92 = ... a2

Coding in python

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions