Practical Assignment: Data Handling,
Financial & Healthcare Analytics with
Python
Objective
This assignment will help you apply concepts of data manipulation, cleaning, encoding, and
visualization to real-world financial and healthcare datasets, as discussed in the sessions. You
will implement tasks using NumPy, Pandas, Matplotlib, and Seaborn.
Tasks
Part A: Data Handling Basics
1. Import the required libraries: numpy, pandas, [Link], and seaborn.
2. Load any given CSV file (you may create a small sample dataset if one is not provided).
○ Display the first 5 records using .head().
○ Print the dataset summary using .info().
Part B: Financial Analytics
Dataset Columns (from transcript): Loan_ID, Gender, Married, Dependents, Education,
Self_Employed, ApplicantIncome, CoapplicantIncome, LoanAmount, Loan_Amount_Term,
Credit_History, Property_Area, Loan_Status
DMV-2 (1)
1. Drop the Loan_ID column, as it does not contribute to analysis.
2. Identify categorical columns (Gender, Married, Education, Self_Employed,
Property_Area, Loan_Status). Convert them to numeric using Label Encoding.
3. Handle missing values:
○ Replace missing values in numeric columns (e.g., LoanAmount,
Credit_History) with their mean.
○ Justify why replacing is better than dropping in this case.
4. Create bar charts for categorical features (e.g., Gender distribution, Loan Status
distribution).
5. Write a short interpretation of what the patterns suggest about loan eligibility.
Part C: Healthcare Analytics
Dataset Columns (from transcript): PatientID, AppointmentID, Gender, ScheduledDay,
AppointmentDay, Age, Neighbourhood, Scholarship, Hypertension, Diabetes, Alcoholism,
Handicap, SMS_received, No-show
DMV-3 (1)
1. Drop identifier/date columns: PatientID, AppointmentID, ScheduledDay,
AppointmentDay.
2. Convert categorical columns (Gender, Neighbourhood, No-show) into numeric
using Label Encoding.
3. Generate summary statistics:
○ Distribution of Age, Hypertension, Diabetes, Alcoholism, Handicap.
4. Visualizations:
○ Pie chart showing gender distribution of patients.
○ Bar chart comparing counts of patients with Hypertension, Diabetes, Alcoholism,
and Handicap.
○ Bar chart of SMS_received vs No-show.
5. Write a short note on what these charts reveal about healthcare attendance behavior.
Part D: Reflection
Answer the following questions briefly:
1. Why is handling missing values important before visualization or analysis?
2. What role does Label Encoding play in preparing categorical data?
3. From the visualizations, what real-world insights can you derive for:
○ Banks (loan eligibility)?
○ Hospitals (patient attendance)?
Deliverables
● A Jupyter Notebook (.ipynb) with step-by-step code and visualizations.
● A 1–2 page summary (Word/PDF) interpreting your results in plain English.