Question: Please help, data science class using python3 jupyter 2. Faculty salaries In the next cell, we load a dataset created by the Daily Cal which

 Please help, data science class using python3 jupyter 2. Faculty salaries

In the next cell, we load a dataset created by the Daily

Please help, data science class using python3 jupyter

2. Faculty salaries In the next cell, we load a dataset created by the Daily Cal which contains Berkeley faculty, their departments, their positions, and their gross salaries in 2015 [12]: raw-profs profs profs = Table .read-table( "faculty .csv").where ("year ", raw_profs.relabel ("title_category, "position") In are . equal-to (2015)).drop ("year ", "title") Out [12] position gross salary 64450 184998 3466 138775 100300 319693 191162 14779 101567 182288 name CYNTHIA ABAN PIETER ABBEEL SALLY ABEL ELIZABETH ABEL DOR ABRAHAMSON KATHRYN ABRAMS BARBARA ABRAMS SARAH ACCOMAZZO CHARISMA ACEY DAVID ACKERLY South & Southeast Asian Studies Computer Science Law English Education Law Public Health Social Welfare City and Regional Planning Biology lecturer associate professor lecturer professor associate professor professor lecturer assistant professor ...(2049 rows omitted) Question 1. Set prof_names to a table with two columns. The first column should be called department and have the name of every department once and the second column should be called faculty and contain an array of the names of all faculty members in that department. Hint: Think about how group works: it collects values into an array and then applies a function to that array. We have defined two functions below for you, and you will need to use one of them in your call to group In [26]: # Pick one of the two functions defined below in your call to group. def identity (array): return array def first (array): return array.item(0) In [27]: prof-names prof_names = File "", line 1 pro names SyntaxBrror: invalid syntax In [29]: _- ok.grade( 'q2_1') Question 2. At the moment, the name column is sorted by last name. Would the arrays you generated in the previous part be the same if we had sorted by first name instead before generating them? Two arrays are the same if they contain the same number of elements and the elements located at corresponding indexes in the two arrays are identical. Explain your answer. If you feel you need to make certain assumptions about the data, feel free to state them in your response Write your answer here, replacing this text. Question 3. Set biggest_range_dept to the name of the department with the largest salary range, where range is defined as the difference between the highest salary and the lowest salary in the department. Hint: First you'll need to define a new function salary_ range which takes in an array of salaries and returns the salary range of the corresponding department. Then, set department_ranges to a table containing the names and salary ranges of each department. In [9]: # Define salary-range in this cell In [11] department_ranges biggest_ range_ dept biggest_range_dept - In [101:ok.grade('q2_3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!