Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In [79]: K Edit Metadata raw_profs = Table. read_table(faculty.csv) . where(year, are. equal_to(2015) ) . drop(year, title) profs = raw_profs . relabeled(title_category, rank) profs Out
In [79]: K Edit Metadata raw_profs = Table. read_table("faculty.csv") . where("year", are. equal_to(2015) ) . drop("year", "title") profs = raw_profs . relabeled("title_category", "rank") profs Out [79] : name department rank gross_salary CYNTHIA ABAN South & Southeast Asian Studies lecturer 64450 PIETER ABBEEL Computer Science associate professor 184998 SALLY ABEL Law lecturer 3466 ELIZABETH ABEL English professor 138775 DOR ABRAHAMSON Education associate professor 100300 KATHRYN ABRAMS Law professor 319693 BARBARA ABRAMS Public Health professor 191162 SARAH ACCOMAZZO Social Welfare lecturer 14779 CHARISMAACEY City and Regional Planning assistant professor 101567 DAVID ACKERLY Biology professor 182288 ... (2049 rows omitted) Edit Metadata We want to use this table to generate arrays with the names of each professor in each department. Edit Metadata Question 1. For each rank, who is the highest paid person in this data set? Use the group function and the max function to create a small table showing the highest paid faculty member within each rank.Edit Metadata Question 1. For each rank, who is the highest paid person in this data set? Use the group function and the max function to create a small table showing the highest paid faculty member within each rank. In [ ]: K Edit Metadata Edit Metadata Question 2. Using a combination of group , select , np. mean , and relabel , create this table. Rank Average Salary assistant professor 131831 associate professor 128869 lecturer 38190.3 professor 199949 In [ ]: H Edit Metadata #Put your code here Edit MetadataEdit Metadata Question 3. Set department_ranges to a table containing departments as the rows, and the position as the columns. The values in the rows should correspond to a salary range, where range is defined as the difference between the highest salary and the lowest salary in the department for that position. Hint: First we will define a custom function range which takes in an array and returns the range (difference between minimum and maximum) of the numbers in that array. K :U Edit Metadata # Define a custom range first def range (array ) : ""Computes diff between max and min in array" " diff = np. max(array) - np. min(array) return diff department_ranges = . .. department_ranges Edit Metadata Question 4. Give an explanation as to why some of the row values are @ in the department_ranges table from the previous question. Edit Metadata Write your answer here, replacing this text
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started