Skip to content
0

📖 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 / Junior
    • MI: Mid-level / Intermediate
    • SE: Senior / Expert
    • EX: Executive / Director
  • employment_type - Employment type:
    • PT: Part-time
    • FT: Full-time
    • CT: Contract
    • FL: 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)

💪 Competition challenge

In this second level, you’ll create visualisations to analyse the data and uncover trends. If you’re up for an even greater challenge, head to level three! Create a report that answers the following:

  • Create a bar chart displaying the top 5 job titles with the highest average salary (in USD).
  • Compare the average salaries for employees working remotely 100%, 50%, and 0%. What patterns or trends do you observe?
  • Visualise the salary distribution (in USD) across company sizes (S, M, L). Which company size offers the highest average salary?

🧑‍⚖️ 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

⌛️ Time is ticking. Good luck!

Bar Chart for Top 5 Job Titles with the Highest Average Salary

import pandas as pd
import matplotlib.pyplot as plt

# Load the dataset
df = pd.read_csv('salaries.csv')

# Calculate average salary by job title
top_jobs = df.groupby('job_title')['salary'].mean().nlargest(5)

# Create a bar chart
plt.figure(figsize=(10, 6))
top_jobs.plot(kind='bar', color='skyblue')
plt.title('Top 5 Job Titles with the Highest Average Salary')
plt.xlabel('Job Title')
plt.ylabel('Average Salary (USD)')
plt.xticks(rotation=45)
plt.show()

Compare Average Salaries for Different Remote Work Levels

# Calculate average salary by remote work percentage
remote_salaries = df.groupby('remote_ratio')['salary'].mean()

# Create a bar chart
plt.figure(figsize=(10, 6))
remote_salaries.plot(kind='bar', color='lightgreen')
plt.title('Average Salaries by Remote Work Ratio')
plt.xlabel('Remote Work (% of Time)')
plt.ylabel('Average Salary (USD)')
plt.xticks(rotation=0)
plt.show()

Visualize Salary Distribution Across Company Sizes

# Calculate average salary by company size
company_size_salaries = df.groupby('company_size')['salary'].mean()

# Create a bar chart
plt.figure(figsize=(10, 6))
company_size_salaries.plot(kind='bar', color='coral')
plt.title('Average Salary Distribution Across Company Sizes')
plt.xlabel('Company Size')
plt.ylabel('Average Salary (USD)')
plt.xticks(rotation=0)
plt.show()

Salary Data Analysis Report

Introduction

This report analyzes salary trends in the tech industry based on various parameters, including job titles, remote work status, and company size. The visualizations highlight key insights into compensation patterns.

1. Top 5 Job Titles with the Highest Average Salary

Top 5 Job Titles Bar Chart

The chart above displays the top 5 job titles with the highest average salaries in USD. The analysis reveals that The tech industry offers competitive salaries, especially for specialized roles that require advanced skills. The top five highest-paying positions include Principal Data Architect, Data Scientist Lead, AI Software Development Engineer, Lead Machine Learning Engineer, and Manager of Data Management.

The Principal Data Architect earns the highest salary due to their critical role in designing complex data systems essential for data-driven decision-making. The Data Scientist Lead follows closely, guiding teams to translate data insights into actionable strategies. AI Software Development Engineers and Lead Machine Learning Engineers are in high demand as organizations increasingly rely on AI technologies for innovation. Finally, the Manager of Data Management ensures data quality and compliance, which are vital as regulations tighten.

Overall, these roles command high salaries due to their specialized expertise, strategic importance, and the growing need for skilled professionals in an evolving tech landscape.

2. Average Salaries by Remote Work Ratio

Average Salaries by Remote Work Ratio

This visualization compares average salaries for employees working remotely 100%, 50%, and 0%. Observations include:

  1. Salary Trends by Remote Work Ratio:

    • Employees who work 50% remotely generally earn the highest salaries compared to those working 0% or 100% remotely. This suggests that a hybrid work model may attract higher compensation, possibly due to the combination of in-office collaboration and flexibility.
  2. Comparison of Fully Remote and In-Office Workers:

    • Notably, employees who work 100% remotely earn less than those who work 50% of the time. This might indicate that companies value the in-person collaboration provided by a hybrid model, leading to higher pay for those who split their time between the office and remote work.

Overall, the data suggests that a balanced approach to remote work may offer the best salary potential for employees.

3. Average Salary Distribution Across Company Sizes

Salary Distribution by Company Size

The chart illustrates the average salary distribution across company sizes (Small, Medium, Large). Key findings include:

  1. Highest Average Salary:

    • Small companies offer the highest average salary among the three categories, surpassing both medium and large companies.
  2. Possible Reasons for Salary Differences:

    • Salary differences based on company size could be attributed to various factors, such as:
      • Resource Allocation: Small companies may offer competitive salaries to attract top talent, compensating for fewer benefits or job security.
      • Flexibility and Culture: Smaller firms often provide a more agile work environment, which can be appealing to employees, potentially justifying higher pay.
      • Market Positioning: Small companies may be positioned in niche markets where specialized skills command higher salaries.

These insights highlight how company size can influence compensation strategies and employee preferences.