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

Loan Eligibility Checker Program

This document discusses a case study for a banking marketing campaign. The bank wants to offer loans to clients with particular professions based on data from previous successful campaigns. The tasks are to read a dataset file containing client data, build a list of unique professions, and check if a given client's profession makes them eligible for the marketing campaign. The solution provided reads the data file, extracts unique job titles, and allows inputting a profession to check eligibility and offer loans to eligible clients.
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)
89 views2 pages

Loan Eligibility Checker Program

This document discusses a case study for a banking marketing campaign. The bank wants to offer loans to clients with particular professions based on data from previous successful campaigns. The tasks are to read a dataset file containing client data, build a list of unique professions, and check if a given client's profession makes them eligible for the marketing campaign. The solution provided reads the data file, extracts unique job titles, and allows inputting a profession to check eligibility and offer loans to eligible clients.
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

Module 3

Deep Dive - Functions, OOPs, Modules, Errors and Exceptions


Case Study - II

1. Business challenge/requirement
Bank of Portugal runs marketing campaign to offer loans to clients. Loan is
offered to only clients with particular professions. List of successful campaigns (with
client data) is given in attached dataset. You have to come up with program which reads
the file and builds a set of unique profession list and given input profession of client –
system tells whether client is eligible to be approached for marketing campaign.

Answer:

import pandas as pd

import numpy as np

data = open("./[Link]",'rb')

df = pd.read_csv(data) # read the data

unique_jobs = [[Link]() for jobs in [Link](df['job'].values)] # converting all jobs to lower

print("Set of uniques jobs : ",unique_jobs) # printing set of unique jobs

flag = 1

while(flag==1):

job_input = input("Please enter your job : ") # enter jon input till user enter END

if job_input.lower() in unique_jobs: # making input case insensitive

print("Job is in the list. Eligible for loan.")

elif job_input.upper() == 'END':

flag = 0

else : print("job not found. Not eligible for loan")


age_dict = {'max':max(df['age'].values),'min':min(df['age'].values)} # dictionary to store max and
min age

print("max age of loan : ",age_dict.get('max')) # print max age from dictionary

print("min age of loan : ",age_dict.get('min')) # print min age from dictionary

******

Common questions

Powered by AI

The data processing strategy implies that the target audience is selective, focusing on clients with professions listed as successful in past campaigns. This indicates the bank's strategy to optimize marketing efficiency by targeting groups more likely to secure loans based on historical data, rather than casting a wide net .

Case insensitivity ensures a consistent and error-free user experience by eliminating mismatches due to capitalization differences, which can occur due to inconsistencies in data entry or user input. In this program context, it ensures that eligible professions are not mistakenly judged as ineligible, thereby preventing potential loss of business opportunities for the bank .

The integration of pandas and numpy enhances data manipulation capabilities, allowing for efficient data reading, organization, and analysis. Pandas provides a structured data frame to store client information, while numpy facilitates operations like extracting unique professions, which is crucial for assessing eligibility and ensuring data integrity .

The program reads a dataset of successful campaigns, extracting a list of unique professions from the client data. It then compares the entered profession against this list to determine eligibility. If the entered profession, converted to lowercase, is found in the list of unique professions, the client is deemed eligible for the marketing campaign. If not, the client is considered not eligible. The program also allows the user to exit by entering 'END' .

The program’s architecture is modular, using a set of unique professions and age parameters extracted directly from a dataset which can be updated or expanded as needed. This modularity allows for easy addition or removal of criteria without significant changes to the underlying code. For example, expanding criteria to include new professions can be as simple as updating the dataset .

The program implicitly handles user input errors by checking if the entered profession matches any in the stored list of unique professions. If the profession is not found, it informs the user that the job was not found and they are not eligible. While basic, this feedback loop prevents the program from crashing due to unexpected input and guides the user in input correction .

The program creates a dictionary to hold the maximum and minimum ages of clients eligible for loans, extracted using the `max()` and `min()` functions on the client age data in the dataset. By printing these values, it provides insights into the age range of clients who successfully obtained loans, allowing the bank to understand the typical age profile of eligible clients .

The program uses the `lower()` method to convert all professions in the dataset to lowercase and also converts user input to lowercase. This case-insensitivity facilitates a smooth user experience by accommodating variations in capitalization, which could otherwise lead to incorrect eligibility determinations due to case mismatches .

To dynamically update the professions list, the system could incorporate real-time data feeding directly from the bank's systems or customer relationship management tools. Implementing a database that periodically refreshes based on latest successful client data would ensure the list remains current. Automation scripts feeding data into these systems could prevent the need for manual updates .

The program utilizes a list (converted to lower case) to hold unique professions from the dataset. By storing professions in a list, it allows for efficient retrieval and comparison operations when checking eligibility. The `np.unique` function ensures that the list only contains unique entries, which optimizes the search process .

You might also like