📖 Background
You work for an international HR consultancy helping companies attract and retain top talent in the competitive tech industry. As part of your services, you provide clients with insights into industry salary trends to ensure they remain competitive in hiring and compensation practices.
Your team wants to use a data-driven approach to analyse how various factors—such as job role, experience level, remote work, and company size—impact salaries globally. By understanding these trends, you can advise clients on offering competitive packages to attract the best talent.
In this competition, you’ll explore and visualise salary data from thousands of employees worldwide. f you're tackling the advanced level, you'll go a step further—building predictive models to uncover key salary drivers and providing insights on how to enhance future data collection.
💾 The data
The data comes from a survey hosted by an HR consultancy, available in 'salaries.csv'
.
Each row represents a single employee's salary record for a given year:
work_year
- The year the salary was paid.experience_level
- Employee experience level:EN
: Entry-level / JuniorMI
: Mid-level / IntermediateSE
: Senior / ExpertEX
: Executive / Director
employment_type
- Employment type:PT
: Part-timeFT
: Full-timeCT
: ContractFL
: Freelance
job_title
- The job title during the year.salary
- Gross salary paid (in local currency).salary_currency
- Salary currency (ISO 4217 code).salary_in_usd
- Salary converted to USD using average yearly FX rate.employee_residence
- Employee's primary country of residence (ISO 3166 code).remote_ratio
- Percentage of remote work:0
: No remote work (<20%)50
: Hybrid (50%)100
: Fully remote (>80%)
company_location
- Employer's main office location (ISO 3166 code).company_size
- Company size:S
: Small (<50 employees)M
: Medium (50–250 employees)L
: Large (>250 employees)
Executive summary
- This survey included employee data from five(5) different years between 2020 and 2024.
- The data frame had 11 columns and 57194 rows with a total of 629134 data entries.
- The average salaries for Data Scientists and Data Enginners are 159397.07 and 149315.00 (in USD) respectively.Therefore, Data Scientists earn more in USD than Data Engineers, on average.
- 11125 full-time employees, based in the US, work 100% remotely
#load data into pandas dataframe
import pandas as pd
import numpy as np
salaries_df = pd.read_csv('salaries.csv')
# What is the dimension of the data set?
print('There are', salaries_df.shape[0], 'rows and', salaries_df.shape[1], 'columns in the data set')
#What is the size of the data set?
print('The size of the data set is', salaries_df.size)
#How many work years were included in the survey?
year_count=salaries_df['work_year'].nunique()
print('A',year_count,'year period was included in the survey')
# What range of years did this survey cover?
years = sorted(salaries_df['work_year'].unique())
print('This survey spanned over the following years:', years)
#What is the average salary (in USD) for Data Scientists and Data Engineers?
##group by job title and salary in USD, then aggregate by average
avg_salaries=salaries_df.groupby('job_title')['salary_in_usd'].mean().reset_index()
##filter specific roles from job title column and extract salary value in USD
avg_sal_DS= avg_salaries.loc[avg_salaries['job_title'] == 'Data Scientist', 'salary_in_usd'].values
avg_sal_DE= avg_salaries.loc[avg_salaries['job_title'] == 'Data Engineer', 'salary_in_usd'].values
##round off salary values and print summary
print('The average salaries for Data Scientists and Data Enginners are', np.round(avg_sal_DS[0],2), 'and', np.round(avg_sal_DE[0],2), ' (in USD) respectively.' )
print('Therefore, Data Scientists earn more in USD than Data Engineers, on average.')
#How many full-time employees based in the US work 100% remotely?
filt=(salaries_df['employment_type']=='FT') & (salaries_df['employee_residence']=='US') & (salaries_df['remote_ratio']==100)
#count the number of employees which meet the filter criteria
filt_count=salaries_df[filt].count().values
#pick one value output
filt_count[0]
#print summary output
print(filt_count[0], 'full-time employees, based in the US, work 100% remotely')
💪 Competition challenge
In this first level, you’ll explore and summarise the dataset to understand its structure and key statistics. If you want to push yourself further, check out level two! Create a report that answers the following:
- How many records are in the dataset, and what is the range of years covered?
- What is the average salary (in USD) for Data Scientists and Data Engineers? Which role earns more on average?
- How many full-time employees based in the US work 100% remotely?
🧑⚖️ Judging criteria
This is a community-based competition. Once the competition concludes, you'll have the opportunity to view and vote for the best submissions of others as the voting begins. The top 5 most upvoted entries will win. The winners will receive DataCamp merchandise.
✅ Checklist before publishing into the competition
- Rename your workspace to make it descriptive of your work. N.B. you should leave the notebook name as notebook.ipynb.
- Remove redundant cells like the judging criteria, so the workbook is focused on your story.
- Make sure the workbook reads well and explains how you found your insights.
- Try to include an executive summary of your recommendations at the beginning.
- Check that all the cells run without error