ESE Ques Pattern
ESE Ques Pattern
2. Add a second line to the same plot representing the monthly average bonus (amount)
for the same city:
bonus = [7800, 6000, 5500, 4500, 6000, 7000, 8500, 8000, 7500, 7000, 8500, 9000]
B) You are provided with a dataset containing information about sales transactions from a
retail store. The dataset includes the following columns:
Using Python's pandas library, write a script to perform the following data wrangling tasks:
1. (3 marks) Handle missing values in the Gender column:
o Fill missing Gender values with the mode (most frequent value).
o Display the number of missing values in the Gender column before and after
filling.
2. (2 marks) Calculate the YearsAtCompany for each employee based on the current
date (assume today's date is September 1, 2024) and the JoinDate. Populate the
YearsAtCompany column with the calculated values and display the first 5 rows of
the updated DataFrame.
3. (3 marks) Standardize the Name column by converting all names to title case (e.g.,
"alice johnson" should become "Alice Johnson"). Display the first 5 rows of the
updated DataFrame.
4. (2 marks) Remove any duplicate rows in the DataFrame based on the EmployeeID
column and display the number of rows before and after removing duplicates.