Description
The HR boss needs to know some important details about the employees. Find out the answers to the following questions:
What are the departments of the top ten employees in terms of working hours?
What is the total number of projects on which IT department employees with low salaries have worked?
What are the last evaluation scores and the satisfaction levels of the employees
A4,B7064, andA3033?
Objectives
After successfully sorting in the previous stage, continue expanding your program by adding the functionalities listed below. Answer the questions from the description using the pandas built-in methods. Here is a little explanation for each question:
Use
average_monthly_hourscolumn to sort the dataset in descending order, select top 10 employees based on this sorted data and output a Python list of corresponding departments' names;Filter the database based on
ITforDepartmentcolumn andlowforsalarycolumn. Then, sum up the values from thenumber_projectcolumn and output the total number of projects for this filtered database;Finally find
last_evaluationandsatisfaction_levelvalues for the employeesA4,B7064, andA3033. Output a Python list where each entry is a list of values of the last evaluation score and the satisfaction level of an employee. The data for each employee should be specified in the same order as the employees' IDs in the question above. Apply the.locmethod ofpandasto answer the question!
We advise using Google before implementing a logic-intensive approach. The chances are there is a ready-to-use method in pandas that will solve the problem in one line.
Print answers to all three questions — each on a separate line.
Example
Input data:
The merged DataFrame from the previous stage.
Output (the answer is for reference only; the actual values may differ):
['hr', 'support', 'management', 'management', 'IT', 'sales', 'product_mng', 'product_mng', 'IT', 'technical']
653
[[0.65, 0.89], [0.72, 0.83], [0.55, 0.34]]