문제
Write a query that calculates the difference between the highest salaries found in the marketing and engineering departments. Output just the difference in salaries.
- 마케팅 부서와 엔지니어링 부서 사이의 가장 높은 연봉 차를 계산하여 조회하기
코드
# Import your libraries
import pandas as pd
# Start writing code
db_employee.head()
df = pd.merge(db_employee, db_dept, how="inner", left_on="department_id", right_on="id")
abs(df[(df.department == 'marketing')]['salary'].max()-df[(df.department == 'engineering')]['salary'].max())
출처
반응형
'Algorithm > Python' 카테고리의 다른 글
[stratascratch] Highest Number Of Orders(Python) (0) | 2021.08.22 |
---|---|
[stratascratch] Number Of Units Per Nationality(Python) (0) | 2021.08.22 |
[프로그래머스] 시저 암호 (Python) (0) | 2021.08.20 |
[프로그래머스] 직사각형 별찍기 (Python) (0) | 2021.08.20 |
[stratascratch] Bikes Last Used(Python) (0) | 2021.08.19 |