Learn practical skills, build real-world projects, and advance your career
import pandas as pd
import numpy as np
import seaborn as sns
pd.set_option('display.max_rows', 300)
pd.set_option('display.max_columns', 200)
import matplotlib.pyplot as plt
app = pd.read_csv('application_data.csv',index_col = [0])
prev_app = pd.read_csv('previous_application.csv',index_col=[0])


/Users/AbhinavShekhar/opt/anaconda3/lib/python3.7/site-packages/numpy/lib/arraysetops.py:569: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison mask |= (ar1 == a)
print('Current application:',app.shape)
print('Previous application:',prev_app.shape)
app.info(memory_usage='deep')
Current application: (307511, 121) Previous application: (1670214, 36) <class 'pandas.core.frame.DataFrame'> Int64Index: 307511 entries, 100002 to 456255 Columns: 121 entries, TARGET to AMT_REQ_CREDIT_BUREAU_YEAR dtypes: float64(65), int64(40), object(16) memory usage: 543.7 MB
TARGET VARIABLES IN EACH DATASET
def plot_target(df,column,labels,title):
    df[column].value_counts(normalize=True).plot.bar()
    plt.xlabel(labels[0],fontdict = {'fontsize': 10, 'color': 'blue'})
    plt.ylabel(labels[1],fontdict = {'fontsize': 10, 'color': 'blue'})
    plt.title(title,fontdict = {'fontsize': 20, 'color': 'green'})
    plt.show()
    
plot_target(app,'TARGET',['Payment Difficulty','%'],'Clients with payment difficulties')
plot_target(prev_app,'NAME_CONTRACT_STATUS',['Status','%'],'Previous Application Status')

Notebook Image
Notebook Image
CURRENT APPLICATION