0% found this document useful (0 votes)
3 views2 pages

Matplotlib and Seaborn

The document outlines a data analysis project involving employee data, including attributes such as department, city, salary, and performance metrics. It provides a series of visualization tasks, including bar charts, line charts, scatter plots, boxplots, and heatmaps to analyze various aspects of the dataset. The analysis aims to explore relationships and trends within the data, such as salary by department and performance scores over time.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Matplotlib and Seaborn

The document outlines a data analysis project involving employee data, including attributes such as department, city, salary, and performance metrics. It provides a series of visualization tasks, including bar charts, line charts, scatter plots, boxplots, and heatmaps to analyze various aspects of the dataset. The analysis aims to explore relationships and trends within the data, such as salary by department and performance scores over time.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

[Link].

seed(42)

Create date range


dates = pd.date_range(start="2023-01-01", periods=100)

Departments
departments = ["Sales", "Marketing", "Finance", "HR", "IT"]

Cities
cities = ["Chennai", "Bangalore", "Mumbai", "Delhi"]

Dataset
df = [Link]({
"Employee_ID": [Link](1, 101),
"Date": dates,
"Department": [Link](departments, 100),
"City": [Link](cities, 100),
"Hours_Worked": [Link](4, 10, 100),
"Tasks_Completed": [Link](1, 15, 100),
"Performance_Score": [Link]([Link](2.0, 5.0, 100), 2),
"Salary": [Link](30000, 90000, 100),
"Work_From_Home": [Link]([True, False], 100),
"Experience_Years": [Link](0, 15, 100)
})

To calculate efficiency by task completed with hours worked and round value

1. Bar Chart Questions


Q1. Plot the average salary for each department.
(Hint: [Link]("Department")["Salary"].mean())
Q2. Show the number of employees in each city.
(Hint: df["City"].value_counts())
Q3. Create a bar chart comparing total tasks completed by each department.
2. Line Chart Questions
Q4. Plot the daily performance score trend.
Q5. Plot hours worked over time for a randomly chosen employee.
Q6. Create a multi-line chart showing average daily efficiency for each city.
3. Scatter Plot Questions
Q7. Plot Salary vs Experience Years (with regression line using Seaborn).
Q8. Plot Performance Score vs Efficiency.
Q9. Make a bubble chart:
 X = Experience Y = Salary Bubble Size = Performance
Score**

4. Boxplot / Violin Plot Questions

Q10. Create a boxplot of salary for each department.

Q11. Make a violin plot of performance scores for each city.

Q12. Compare hours worked between Work-From-Home and Office employees


using a boxplot.

5. Heatmap / Correlation Questions

Q13. Create a correlation heatmap of:

 Salary, Hours_Worked, Tasks_Completed, Performance_Score, Experience_Years,


Efficiency.**

Q14. Create a pivot table:

 Rows = City,
Columns = Department,
Values = Average Salary
Then visualize it as a heatmap.**

Q15. Plot a histogram + KDE of Salary.

Q16. Plot the distribution of Performance Score.

Q17. Create a multi-histogram comparing Tasks Completed for each city.

Q18. Make a jointplot of Salary vs Performance Score.


Q19. Create a stacked bar chart of employees grouped by department and WFH
status.

You might also like