0% found this document useful (0 votes)
7 views

Matplotlib Exercise

Uploaded by

reyedo2966
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Matplotlib Exercise

Uploaded by

reyedo2966
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Introduction to Python Matplotlib exercises Dr.

Vishwesh Singbal

Bank branch performance analysis


You are a data analyst working for a bank that has multiple branches across different cities.
The bank wants to analyze the performance of its branches based on metrics such as customer
satisfaction, total deposits, total loans, net profit, and number of customers. Your task is to
create visualizations that can help the bank’s management understand these metrics and make
data-driven decisions.
Dataset: bank_branch_performance.csv
Description of the Dataset:
• Branch ID: Unique identifier for each bank branch.
• City: The city where the branch is located.
• Customers: The number of customers associated with each branch.
• Total Deposits: The total amount of deposits in the branch (in USD).
• Total Loans: The total amount of loans issued by the branch (in USD).
• Net Profit: The net profit of the branch (in USD).
• Customer Satisfaction: A rating of customer satisfaction on a scale from 1 to 10.
Question 1: Visualize the Distribution of Customer Satisfaction Scores.
• Task: Create a histogram to visualize the distribution of customer satisfaction scores
across all branches.
• Hint: Use plt.hist() to create the histogram.
Question 2: Compare the Average Net Profit by City.
• Task: Create a bar chart that shows the average net profit of branches in each city.
• Hint: Use plt.bar() and group the data by the 'City' column.
Question 3: Analyze the Relationship Between Total Deposits and Net Profit.
• Task: Create a scatter plot to visualize the relationship between total deposits and net
profit. Use marker size to represent the number of customers and marker color to
represent customer satisfaction.
• Hint: Use plt.scatter() and map marker sizes and colors to the relevant columns.
Question 4: Explore the Variability in Total Loans Across Branches.
• Task: Create a box plot to explore the variability in total loans across all branches.
Annotate the median, quartiles, and outliers on the plot.
• Hint: Use plt.boxplot() and annotate using plt.text().
Question 5: Visualize the Proportion of Branches in Different Cities.
• Task: Create a pie chart to visualize the proportion of branches located in different
cities.
• Hint: Use plt.pie() and include labels for each city
Introduction to Python Matplotlib exercises Dr. Vishwesh Singbal

Credit card usage analysis


You are working as a data analyst for a credit card company. The company wants to analyze
the spending behavior of its customers. The dataset includes information about the total amount
spent, the credit limit, the number of transactions, and the customer satisfaction score.
Dataset: credit_card_usage.csv

Question 1: Visualize the Distribution of Total Spend.

Create a histogram to visualize the distribution of the total amount spent by customers.

Question 2: Compare the Average Credit Limit by Age Group.

Create a bar chart that shows the average credit limit for different age groups.

Question 3: Analyze the Relationship Between Credit Limit and Total Spend.

Create a scatter plot to visualize the relationship between credit limit and total spend. Use
marker size to represent the number of transactions.

Question 4: Explore Customer Satisfaction Across Different Age Groups.

Create a box plot to explore the variability in customer satisfaction across different age groups.

Question 5: Visualize the Proportion of Customers in Each Age Group.

Create a pie chart to visualize the proportion of customers in each age group.
Introduction to Python Matplotlib exercises Dr. Vishwesh Singbal

Insurance claim analysis


You are analyzing data for an insurance company to understand the patterns in claims made by
customers. The dataset includes information about the claim amount, the type of insurance, the
age of the customer, and whether the claim was approved or rejected.
Dataset: insurance_claims.csv

Question 1: Visualize the Distribution of Claim Amounts.

Question 2: Compare the Average Claim Amount by Insurance Type.

Question 3: Analyze the Relationship Between Age and Claim Amount.

Question 4: Explore the Variability in Claim Amounts by Insurance Type.

Question 5: Visualize the Proportion of Claims Approved vs. Rejected.

Savings account analysis


You are analyzing the activity in savings accounts across different branches of a bank. The
dataset includes information about the account balance, the number of transactions, the
customer's age, and the branch city.
Dataset: savings_account_analysis.csv

Question 1: Visualize the Distribution of Account Balances.

Question 2: Compare the Average Balance by Branch City.

Question 3: Analyze the Relationship Between Age and Account Balance.

Question 4: Explore the Variability in Number of Transactions by Age.

Question 5: Visualize the Proportion of Accounts in Different Branch Cities.

You might also like