Department Highest Salary, simple pandas solution
\n\n# Code\n\nimport pandas as pd\n\ndef department_highest_salary(employee: pd.DataFrame, department: pd.DataFrame) -> pd.DataFrame:\n    \n    df = employee.m
\n\n# Code\n```\nimport pandas as pd\n\ndef department_highest_salary(employee: pd.DataFrame, department: pd.DataFrame) -> pd.DataFrame:\n    \n    df = employee.merge(department, left_on =\'departmentId\', right_on = \'id\', how =\'inner\')\n\n    df[\'max_salary\'] = df.groupby(\'name_y\') [\'salary\'].transform(max)\n\n\n    return df[df.salary == df.max_salary]   [[\'name_y\',\'name_x\',\'max_salary\']].rename(columns = {\'name_y\': \'Department\', \'name_x\':\'Employee\', \'max_salary\': \'Salary\'})\n\n```\n\n![upvote_image_boy.png](https://assets.leetcode.com/users/images/c5481ab2-3369-44c7-a4ee-e01f3f897afe_1721731836.8462052.png)\n
['Database', 'Python', 'Python3', 'Pandas']