Add a column dept_avg_salary showing the average salary of each employee's department.
DataFrame df with columns: name, department, salary, age, city
dept_avg_salary with the department's mean salaryReady to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.