0
$\begingroup$

I have a dataset of loans currently paid or charged off and as the dataset is very large I would like to to do a short summary of things I would think is worth knowing about. Yet I don't know a lot about what is important in loan management.

    id  member_id   loan_amnt   funded_amnt funded_amnt_inv term    int_rate    installment grade   sub_grade   emp_title   emp_length  home_ownership  annual_inc  verification_status issue_d loan_status pymnt_plan  url desc    purpose title   zip_code    addr_state  dti delinq_2yrs earliest_cr_line    inq_last_6mths  mths_since_last_delinq  mths_since_last_record  open_acc    pub_rec revol_bal   revol_util  total_acc   initial_list_status out_prncp   out_prncp_inv   total_pymnt total_pymnt_inv total_rec_prncp total_rec_int   total_rec_late_fee  recoveries  collection_recovery_fee last_pymnt_d    last_pymnt_amnt next_pymnt_d    last_credit_pull_d  collections_12_mths_ex_med  mths_since_last_major_derog policy_code application_type    annual_inc_joint    dti_joint   verification_status_joint   acc_now_delinq  tot_coll_amt    tot_cur_bal open_acc_6m open_act_il open_il_12m open_il_24m mths_since_rcnt_il  total_bal_il    il_util open_rv_12m open_rv_24m max_bal_bc  all_util    total_rev_hi_lim    inq_fi  total_cu_tl inq_last_12m    acc_open_past_24mths    avg_cur_bal bc_open_to_buy  bc_util chargeoff_within_12_mths    delinq_amnt mo_sin_old_il_acct  mo_sin_old_rev_tl_op    mo_sin_rcnt_rev_tl_op   mo_sin_rcnt_tl  mort_acc    mths_since_recent_bc    mths_since_recent_bc_dlq    mths_since_recent_inq   mths_since_recent_revol_delinq  num_accts_ever_120_pd   num_actv_bc_tl  num_actv_rev_tl num_bc_sats num_bc_tl   num_il_tl   num_op_rev_tl   num_rev_accts   num_rev_tl_bal_gt_0 num_sats    num_tl_120dpd_2m    num_tl_30dpd    num_tl_90g_dpd_24m  num_tl_op_past_12m  pct_tl_nvr_dlq  percent_bc_gt_75    pub_rec_bankruptcies    tax_liens   tot_hi_cred_lim total_bal_ex_mort   total_bc_limit  total_il_high_credit_limit  revol_bal_joint sec_app_earliest_cr_line    sec_app_inq_last_6mths  sec_app_mort_acc    sec_app_open_acc    sec_app_revol_util  sec_app_open_act_il sec_app_num_rev_accts   sec_app_chargeoff_within_12_mths    sec_app_collections_12_mths_ex_med  sec_app_mths_since_last_major_derog hardship_flag   hardship_type   hardship_reason hardship_status deferral_term   hardship_amount hardship_start_date hardship_end_date   payment_plan_start_date hardship_length hardship_dpd    hardship_loan_status    orig_projected_additional_accrued_interest  hardship_payoff_balance_amount  hardship_last_payment_amount    debt_settlement_flag    debt_settlement_flag_date   settlement_status   settlement_date settlement_amount   settlement_percentage   settlement_term
11  NaN NaN 10000   10000   10000.0 60 months   14.07%  233.05  C   C3  Teacher 4 years RENT    42000.0 Source Verified Mar-2018    Fully Paid  n   NaN NaN major_purchase  Major purchase  341xx   FL  24.69   0   Oct-2004    0   32.0    NaN 17  0   707 15.7%   34  w   0.0 0.0 11153.669505    11153.67    10000.00    1153.67 0.0 0.0 0.0 Mar-2019    10.38   NaN Jun-2019    0   40.0    1   Individual  NaN NaN NaN 0   0   93913   0   15  0   0   54.0    93206   116.0   0   1   707 111.0   4500    0   0   0   1   5524.0  3793.0  15.7    0   0   161.0   88  18  18  0   18.0    32.0    18.0    32.0    14  1   1   2   4   30  2   4   1   17  0.0 0   0   0   43.8    0.0 0   0   84930   93913   4500    80430   NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN
16  NaN NaN 7000    7000    7000.0  36 months   11.98%  232.44  B   B5  Parole  < 1 year    MORTGAGE    40000.0 Verified    Mar-2018    Fully Paid  n   NaN NaN home_improvement    Home improvement    797xx   TX  20.25   0   Mar-2007    0   60.0    NaN 13  0   5004    36% 29  w   0.0 0.0 7693.314943 7693.31 7000.00 693.31  0.0 0.0 0.0 Mar-2019    5364.25 NaN Mar-2019    0   60.0    1   Individual  NaN NaN NaN 0   0   131726  1   6   0   2   16.0    126722  102.0   2   2   3944    90.0    13900   2   1   4   4   10977.0 4996.0  50.0    0   0   122.0   132 1   1   0   10.0    64.0    5.0 60.0    3   2   2   3   4   19  7   10  2   13  0.0 0   0   2   89.7    33.3    0   0   132817  131726  10000   118917  NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN
17  NaN NaN 20000   20000   20000.0 60 months   26.77%  607.97  E   E5  Mental Health Provider  3 years RENT    33500.0 Not Verified    Mar-2018    Charged Off n   NaN NaN house   Home buying 604xx   IL  24.40   0   Aug-2008    1   NaN NaN 27  0   7364    46% 34  w   0.0 0.0 7236.150000 7236.15 2195.37 5040.78 0.0 0.0 0.0 Apr-2019    607.97  NaN Jun-2019    0   NaN 1   Individual  NaN NaN NaN 0   308 160804  0   21  0   0   29.0    153440  118.0   0   2   2607    110.0   16000   0   0   2   2   5956.0  2767.0  68.6    0   0   115.0   115 20  20  0   26.0    NaN 5.0 NaN 0   3   6   3   3   27  6   7   6   27  0.0 0   0   0   100.0   33.3    0   0   146514  160804  8800    130514  NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN
20  NaN NaN 21000   21000   21000.0 60 months   20.39%  560.94  D   D4  Machine operator    10+ years   OWN 85000.0 Source Verified Mar-2018    Fully Paid  n   NaN NaN house   Home buying 135xx   NY  15.76   1   Nov-2008    0   2.0 NaN 15  0   14591   34.2%   27  w   0.0 0.0 24217.170915    24217.17    21000.00    3217.17 0.0 0.0 0.0 Feb-2019    183.26  NaN May-2019    0   NaN 1   Individual  NaN NaN NaN 0   0   128270  1   1   2   2   7.0 37076   NaN 2   5   5354    34.0    42700   6   4   13  8   8551.0  16684.0 38.4    0   0   67.0    112 4   4   3   4.0 NaN 0.0 2.0 0   5   7   6   10  3   12  21  7   15  0.0 0   0   4   92.6    16.7    0   0   172433  51667   27100   39733   NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN N   NaN NaN NaN NaN NaN NaN
...

As I am a computer scientist it's hard to tell. Yet I know python has a describe function. But it would find the mean, median of all variables and wouldn't help me finding

Annex : recreating dataset

I used a csv file that I downloaded here (bank loans for 2018. They are divided into four quarters). Using Python 3 one can obtain it doing:

import pandas as pd 
# Control delimiters, rows, column names with read_csv (see later) 
data_Q1 = pd.read_csv("LoanStats_2018Q1.csv", skiprows=1, skipfooter=2, engine='python')
data_Q2 = pd.read_csv("LoanStats_2018Q2.csv", skiprows=1, skipfooter=2, engine='python')
data_Q3 = pd.read_csv("LoanStats_2018Q2.csv", skiprows=1, skipfooter=2, engine='python')
data_Q4 = pd.read_csv("LoanStats_2018Q2.csv", skiprows=1, skipfooter=2, engine='python')
frames = [data_Q1,data_Q2,data_Q3,data_Q4]

result = pd.concat(frames)
subset = result.loc[result["loan_status"].isin(['Charged Off','Fully Paid'])]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.