text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data = pd.read_csv('../input/loan.csv', low_memory=False)

data = data[(data.loan_status == 'Fully Paid') | (data.loan_status == 'Default')]

data['target'] = data.loan_status == 'Fully Paid'

data.shape

x = data.loan_amnt

term_groups = data.groupby('term')
term_groups['int_rate'].mean()

grade_groups = data.groupby('grade')
grade_groups['int_rate'].mean()

total_loaned = grade_groups['funded_amnt'].sum()
print(total_loaned)