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

test = pd.read_csv('../input/test.csv', low_memory=False)
train = pd.read_csv('../input/train.csv', low_memory=False)

loans_in_default = train.default.value_counts(True)

default_by_zip = train.default.groupby(train.ZIP).mean()

default_by_year = train.default.groupby(train.year).mean()
print('Question 3', '\n', '\n')
print('Default rate in the first year for which we have data:', default_by_year[0] * 100, '%')