Exploring and Preparing Loan Data

Expected Loss

expected_loss =   PD *  EAD * LGD

Data Columns

Column Column
Income Loan Grade
Age Loan Amount
Home Ownership Interest Rate
Employment Length Loan Status
Loan Intent Historical Default
Percent Income Credit Length History

Exploring with Cross Tables

pd.crosstab(cr_loan['person_home_ownbership'], cr_loan['loan_status'],
						values=cr_loan['loan_int_rate'], aggfunc='mean').round(2)

Exploring with Visuals

plt.scatter(cr_loan['personal_income'], cr_loan['loan_int_rate'], c='blue', alpha=0.5)
plt.xlabel("Personal Income") 
plt.ylabel("Loan Interest Rate")
plt.show() 

Dropping Outlier in One Line

cr_loan_new = cr_loan.drop(cr_loan[cr_loan['person_emp_length'] > 60].index)

Print Null Value Column Array