Question

Write a Python program with suitable comments using pandas that performs the following tasks after
reading the file.
 identify missing values,
 remove duplicate records,
 replace inconsistent values,
 fill missing salary values using an appropriate method, and
 rename the column headings.
(d) Explain different techniques used for handling missing data. Discuss situations where each technique is
appropriate. (3 Marks)
8
(e) A dataset contains the ages of 500 customers ranging from 18 to 80 years. Explain different ways to
classify these customers into age groups using discretisation (binning). (4 Marks)
(f) Write Python code to detect outliers using the interquartile range method. Also, explain the strategies for
handling outliers in data with the help of suitable examples. (4 Marks)
Q2:
(a) Two data files contain customer details and purchase details having the same format. These files may
contain overlapped data. Write and explain the Python program to merge the two files. Make and state
assumptions, if any (3 Marks)
(b) Explain hierarchical indexing. Illustrate how hierarchical indexing can be used for reshaping datasets
with suitable examples. (3 Marks)
(c) A supermarket dataset contains the following fields: (3 Marks)
 Region
 Product Category
 Sales
 Profit
Write a Python program to perform the following tasks:
 group data by Region,
 calculate total sales,
 calculate average profit.
(d) Why is the need to create groups during data analysis? Explain with the help of an example. Explain the
working of the groupby() function in pandas. Discuss grouping using dictionaries, functions and Series
in Python with suitable examples. 
(e) Make a synthetic dataset containing monthly sales of three different products for one year. Write a
Python program using Matplotlib and/or Seaborn to generate a line plot and a scatter plot. Make suitable
assumptions. 
(f) Write a Python code to demonstrate the purpose of figures, axes, labels, legends, annotations and subplot
arrangements with suitable examples.
 

 

30 Jul 2026
Answer :
Word Count : 874
Data wrangling is the process of cleaning, transforming, and organizing raw data into a suitable format for analysis and visualization. Python's pandas library provides efficient functions for handling missing values, duplicates, inconsistent entries, and data transformation. ```python # Import pandas import pandas as pd # Read the CSV file df = pd.read_csv("employee_data.csv") # Display missing values in each column print("Missing Values:") print(df.isnull().sum()) # Remove duplicate records df = df.drop_duplicates() # Replace inconsistent values in Gender column df["Gender"] = df["Gender"].replace({ "M": "Male", "F": "Female", "male": "Male", "female": "Female" }) # Fill missing salary values with median salary df["Salary"] = df["Salary"].fillna(df["Salary"].median()) # Rename column headings df = df.rename(columns={ "EmpID": "Employee_ID", "EmpName": "Employee_Name", "Dept": "Department", "Salary": "Monthly_Salary" }) print(df.head()) ``` Missing data handling techniques are essential because incomplete data may reduce the accuracy of analysis. Deletion methods include listwise deletion, where rows containing missing values are removed. This method is appropriate when only a small percentage of records is missing and sufficient data remain. Pairwise deletion removes only missing values needed for a particular analysis and is ______ ____ ________ ________ ________ ____ _______ _________ __________.
_____ _____ ____ ___ __________ _________ ________ ___.
_____ ____ ___ ______ ___ _________ _____ _________ ___.
_________ ____ ___ ____ _______ _________ _________ _________ _____.
___ _________ __________ _______ ________ _________ ______ _____ ____ _____ _________ ___.
_______ ___ ________ _________ _______ _________ ________ _______ __________ ____ ____.
___ ___ _________ ____ _______ ____.
___ ___ _______ _________ ____ ____ ____ __________ _________.
_______ ____ ____ ___ ____ ________ _____.
___ ___ ___ _____ ________ ________ _______.
______ _______ _____ ________ ____ ______ ____ _______.
__________ __________ ____ _________ _______ _____ _____.
_____ ________ _________ ______ ________ _______.
_______ _____ __________ _________ ___ ________ __________.
__________ _________ ________ _______ _______ ________ ____ __________.
____ ________ ____ _________ ______ __________ __________ ___.
________ ___ _____ ___ _______ _______.
_________ _____ __________ _______ ______ ____ ____ ___ _________ _________ ____.
________ ___ _______ _______ _______ _________ _____.
__________ _____ __________ _____ _________ ___ _______.
___ __________ ________ ___ __________ ________ ____ __________.
___ ________ ____ ______ ______ __________ ______ ________ _______ ______ _________.
_______ ________ ________ _____ ____ __________ ______ _____ _______ ___ __________ _____.
_____ __________ _______ _____ _____ _______ ________ ____ ___ _________ ___ _______.
_____ __________ ___ __________ _______ ________ __________ ____ _____ _________ _______.
___ ______ ____ ___ ________ _______ _______ _______ ___ _______.
___ _____ ___ __________ ___ _________ _____ _________ _______ _____ _______.
____ _________ ____ _______ ___ _______.
____ _______ ________ ___ ___ __________ _______ _________.
__________ __________ ______ ___ _________ _____ ______ __________.
___ ______ _____ ______ ____ _____ _______ __________.
___ ___ __________ _________ ______ ________ ______ ______ _______ ___.
________ ________ _______ __________ ___ ____ __________ ___ _______ ______.
___ ___ _____ _____ ____ _______ _________ ______ ___ ______ _____ __________.
____ ___ _________ _________ ___ ____ ______ ____ ___.
_____ _______ _______ ________ _________ __________ _____ _________ ______ ______.
________ _________ ___ ________ _________.
______ ______ _____ __________ ________ ___ ___ ________.
______ ___ _______ ___ _____ _______ _________ ______ ______ _________ _________ _____.
_______ ___ _______ _____ _________ ____ ________ _________ ___ __________ _______.
_________ _______ _____ ________ _____ __________ ____ __________.
______ ___ __________ ______ ____ _________ ____.
_______ _________ ______ ____ ______ _________ ________.
_____ _____ __________ ______ _____ ________ __________ _____ ____ _____.
________ _____ _____ ______ _______ ________ ____ ________ ______.
_____ ________ ____ ________ __________ ________ _____ __________ __________ _________ _________.
___ __________ ________ _______ ______.
____ _________ ___ ____ ______.
_________ ___ ______ __________ _______ ________ ________ _____ __________ ______.
____ ________ ________ _______ ____ __________ _________ ________ _______ ________ __________.
_______ ____ ___ ________ _____ _____ _________ ______ ________ ______.
___ _________ __________ __________ _______.
________ _____ ____ ____ __________ _________ __________ _________ ________ ___ _____.
________ ___ ___ _____ _______ _____ _________ _________ ______ _______ __________.
________ ___ ________ _______ _____ ________ _________ ______ ____ ______.
____ _____ ____ _____ ___ ____ ______ _________ ___.
_______ ____ ____ _________ _______ ____ _______.
_______ ______ ___ ____ ________ _________ ______ ____.
____ _____ _______ ______ ________ ______ __________.
__________ _________ _____ _____ _____ __________ ____ ____ __________ ___ ______ _________.
____ ___ _____ __________ _______ __________.
_______ _________ ________ _____ ___.
____ _____ ________ ____ ______ __________ ___ _________ ______ _____ ____ ____.
___ ___ ________ ____ ______ _______ _________ ___ ___ ____.
___ _____ ____ ___ ____ __________ ___ _______ ________ ________.
___ __________ _______ _________ _____ ______ ____ _________ _______ _______.
___ _________ _______ ________ ________ _______ _____ ___ __________ __________.
_______ _________ _________ ________ _________.
____ ___ _________ _______ _____ _________ __________ _________ ____ ________.
_______ ________ _________ _____ _________ _______ __________ _______ ____ ___ __________ _____.
______ ________ _______ __________ __________ ____.
_______ _____ ________ ____ ___ ______ __________.
_________ ________ ____ ________ _____ ____.
_______ ____ ____ _________ _____ _________ ________.
_______ ___ __________ ___ ______ ________ __________ ________.
_________ ______ _______ _______ ____.
____ ___ __________ ______ _____.
__________ ___ _______ ______ _______ ________ ________.
________ ____ __________ __________ _______.
________ _____ ______ ____ ________.
_____ __________ _____ _______ __________ __________ _________ ____ __________ ___ ____ ________.
__________ _______ _______ _____ ______ ____ __________ _________ ______ _________.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write a Python program with suitable comments using pandas that perfor
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→