Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

=+8. We cant wait __________ their decision much longer.

Answered: 1 week ago

Question

=+In items 610, provide the missing preposition:

Answered: 1 week ago