Skip to content

ammarelsayed-2a/Project-15-Python-For-Data-Analysis-HR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project-15-Python-For-Data-Analysis-HR

End-to-end HR Analytics on 2 million employee records | Analyzing workforce distribution, attrition, salary trends, performance & hiring patterns using Python, Pandas & Seaborn

👥 HR Data Analysis — Multinational Corporation (2M Employees)

An end-to-end HR Analytics project on 2,000,000 employee records, completed as part of the Python for Data Analysis course.

📌 Objective

Analyze workforce distribution, attrition rates, salary trends, performance ratings, hiring patterns, and Remote vs On-site comparisons for a global MNC.

📂 Dataset

  • Source: HRData.csv
  • Records: 2,000,000 employees
  • Departments: IT, Marketing, HR, Operations, Finance, Sales, R&D
  • Features: Employee_ID, Full_Name, Department, Job_Title, Hire_Date, Location, Performance_Rating, Experience_Years, Status, Work_Mode, Salary_INR

⚠️ Dataset not included due to file size (>25MB).

🛠️ Tools & Libraries

Library Purpose
Pandas Data cleaning, groupby, pivot_table, apply
Matplotlib Bar charts, line charts, scatter plots
Seaborn Heatmaps, boxplots

🔧 Key Pandas Techniques

Technique Purpose
groupby().apply(nlargest) Top-N records per group (Q14)
pivot_table() Cross-tabulation: Dept × Job Title (Q6)
str.split().str[-1] Extract country from Location string
resample() / dt.year Time-based hire trend analysis
Attrition Rate formula Resigned / Total per Dept × 100

❓ Analytical Questions (Q1 → Q15)

# Question
Q1 Distribution of Employee Status
Q2 Distribution of Work Modes
Q3 Employee count per Department
Q4 Average salary by Department
Q5 Job title with highest average salary
Q6 Average salary by Department × Job Title (heatmap)
Q7 Resigned & Terminated count per Department
Q8 Salary variation with Years of Experience
Q9 Average performance rating by Department
Q10 Countries with highest employee concentration
Q11 Correlation between Performance Rating & Salary
Q12 Number of hires per year (trend)
Q13 Remote vs On-site salary comparison
Q14 Top 10 highest-paid employees per Department
Q15 Departments with highest attrition rate

📊 Analysis Structure

  1. Imports & Setup
  2. Load Dataset
  3. First Look
  4. Data Structure & Info
  5. Data Cleaning & Feature Engineering
  6. Analytical Questions (Q1 → Q15)
  7. Key Insights

💡 Key Insights

  • Active employees form the majority, but attrition is significant across departments
  • R&D and Finance command the highest average salaries
  • Salary grows with experience but plateaus after 12+ years
  • Performance rating has weak positive correlation with salary
  • Remote and On-site salaries are nearly identical — pay equity maintained
  • Hiring accelerated significantly from 2018 onwards

🚀 How to Run

git clone https://github.com/ammarelsayed-2a/Project-15-Python-For-Data-Analysis-HR.git
cd Project-15-Python-For-Data-Analysis-HR
jupyter notebook "Project 15 HR.ipynb"

👤 Author

Ammar Elsayed — Python for Data Analysis | 2026
LinkedIn

About

End-to-end HR Analytics on 2 million employee records | Analyzing workforce distribution, attrition, salary trends, performance & hiring patterns using Python, Pandas & Seaborn

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors