Complete the code to group data by the 'department' field.
grouped_data = data.[1]('department')
The groupBy function groups data by the specified column, here 'department'.
Complete the code to join two datasets on the 'employee_id' column.
joined_data = data1.[1](data2, 'employee_id')
The join function combines two datasets based on a common column, here 'employee_id'.
Fix the error in the join operation by completing the code correctly.
result = data1.join(data2, data1.[1] == data2.employee_id)The join condition must compare the same key columns. Here, data1's employee_id matches data2's employee_id.
Fill both blanks to create a dictionary of employee names and their project counts for employees with more than 2 projects.
result = {emp.name: emp.[1] for emp in employees if emp.[1] [2] 2}We use project_count to get the number of projects per employee and filter those with more than 2 projects using >.
Fill all three blanks to create a dictionary of department names and total salaries for departments with total salary above 100000.
dept_salaries = {dept.[1]: sum(emp.[2] for emp in dept.employees) for dept in departments if sum(emp.[2] for emp in dept.employees) [3] 100000}We use name for department names, sum salary for total salaries, and filter departments with total salary > 100000.