In [2]:
import pandas as pd
import numpy as np
from altair import Chart, load_dataset

In [17]:
csv_path = "../data/consumer-complaints.csv"

In [18]:
complaints = pd.read_csv(csv_path, parse_dates=[0], infer_datetime_format=True, low_memory=False)

In [20]:
complaints.head()


Out[20]:
Date received Product Sub-product Issue Sub-issue Consumer complaint narrative Company public response Company State ZIP code Tags Consumer consent provided? Submitted via Date sent to company Company response to consumer Timely response? Consumer disputed? Complaint ID
0 2013-07-29 Consumer Loan Vehicle loan Managing the loan or lease NaN NaN NaN Wells Fargo & Company VA 24540 NaN NaN Phone 07/30/2013 Closed with explanation Yes No 468882
1 2013-07-29 Bank account or service Checking account Using a debit or ATM card NaN NaN NaN Wells Fargo & Company CA 95992 Older American NaN Web 07/31/2013 Closed with explanation Yes No 468889
2 2013-07-29 Bank account or service Checking account Account opening, closing, or management NaN NaN NaN Santander Bank US NY 10065 NaN NaN Fax 07/31/2013 Closed Yes No 468879
3 2013-07-29 Bank account or service Checking account Deposits and withdrawals NaN NaN NaN Wells Fargo & Company GA 30084 NaN NaN Web 07/30/2013 Closed with explanation Yes No 468949
4 2013-07-29 Mortgage Conventional fixed mortgage Loan servicing, payments, escrow account NaN NaN NaN Franklin Credit Management CT 06106 NaN NaN Web 07/30/2013 Closed with explanation Yes No 475823

In [21]:
complaints[complaints['Company public response'].notnull()]['Company public response'].value_counts()


Out[21]:
Company has responded to the consumer and the CFPB and chooses not to provide a public response                            80793
Company chooses not to provide a public response                                                                           52476
Company believes it acted appropriately as authorized by contract or law                                                   30745
Company believes the complaint is the result of a misunderstanding                                                          2734
Company disputes the facts presented in the complaint                                                                       2557
Company believes complaint caused principally by actions of third party outside the control or direction of the company     2361
Company believes complaint is the result of an isolated error                                                               2106
Company can't verify or dispute the facts in the complaint                                                                  1457
Company believes complaint represents an opportunity for improvement to better serve consumers                               955
Company believes complaint relates to a discontinued policy or procedure                                                      39
Name: Company public response, dtype: int64

In [22]:
complaints['Tags'].value_counts()


Out[22]:
Older American                   59587
Servicemember                    35534
Older American, Servicemember     8287
Name: Tags, dtype: int64

In [23]:
complaints['Company response to consumer'].value_counts()


Out[23]:
Closed with explanation            546073
Closed with non-monetary relief     91088
Closed with monetary relief         49181
Closed without relief               17863
Closed                              16897
Closed with relief                   5298
In progress                          4050
Untimely response                    4038
Name: Company response to consumer, dtype: int64

In [19]:
len(complaints)


Out[19]:
734488

In [24]:
complaints['Company'].value_counts()


Out[24]:
Bank of America                             64563
Wells Fargo & Company                       52148
Equifax                                     46034
Experian                                    43345
JPMorgan Chase & Co.                        41463
TransUnion Intermediate Holdings, Inc.      37610
Citibank                                    33612
Ocwen                                       23720
Capital One                                 19526
Navient Solutions, LLC.                     15936
Nationstar Mortgage                         15805
Synchrony Financial                         12401
U.S. Bancorp                                11969
Ditech Financial LLC                        11149
PNC Bank N.A.                                8413
Amex                                         7979
Encore Capital Group                         7572
HSBC North America Holdings Inc.             7052
Discover                                     6183
SunTrust Banks, Inc.                         6005
TD Bank US Holding Company                   5721
Select Portfolio Servicing, Inc              5597
Portfolio Recovery Associates, Inc.          4786
Citizens Financial Group, Inc.               3897
Barclays PLC                                 3835
ERC                                          3724
AES/PHEAA                                    3607
Seterus, Inc.                                3590
Fifth Third Financial Corporation            3564
BB&T Financial                               3228
                                            ...  
Southwest Finance, L.L.C.                       1
National Integrity LLC                          1
Abrahamsen Ratchford, P.C                       1
Vanderwey Investments, LLC                      1
New World Collection, Inc.                      1
Leopold & Associates, PLLC                      1
Professional Credit Analysts of MN, Inc.        1
Rivertown Credit LLC                            1
TCN Inc                                         1
Ideal Lending Solutions, Inc.                   1
Vinson Mortgage Services, Inc.                  1
Aspen Home Mortgage Group                       1
Cheryl A. Warzynski PLLC                        1
New Horizons Finance Company, Inc               1
FCN Catalogue & Equipment, Inc.                 1
Taylor Pigue Marchetti & Blair, PLLC            1
March Motors, Inc.                              1
Mortgages Unlimited Inc                         1
Sentry Abstract Co.                             1
Hello Digit, Inc                                1
Jefferson Title Corporation                     1
The Hamilton Law Association                    1
Vericheck                                       1
Credit Wise Recovery Solution LLC               1
Willow Bend Mortgage Company, LLC               1
Warlick, Stebbins, Murray & Chew, LLP           1
Nations Holding Company                         1
Krawczyk, Duginski & Rohr, S.C.                 1
The Law Offices of Richard W. Krieg, LLC        1
Schiller & Adam, P.A.                           1
Name: Company, dtype: int64

In [25]:
boa = complaints[complaints['Company'] == 'Bank of America']

In [32]:
boa.groupby(['Product', 'Sub-product']).size()


Out[32]:
Product                  Sub-product                           
Bank account or service  (CD) Certificate of deposit                 370
                         Cashing a check without an account          118
                         Checking account                           9495
                         Other bank product/service                 2641
                         Savings account                             749
Consumer Loan            Installment loan                            193
                         Pawn loan                                     5
                         Personal line of credit                     164
                         Title loan                                    7
                         Vehicle lease                                 5
                         Vehicle loan                                280
Debt collection          Auto                                         16
                         Credit card                                 690
                         Federal student loan                          5
                         I do not know                               155
                         Medical                                       1
                         Mortgage                                    493
                         Non-federal student loan                     10
                         Other (i.e. phone, health club, etc.)       225
                         Payday loan                                   3
Money transfers          Domestic (US) money transfer                133
                         International money transfer                124
Mortgage                 Conventional adjustable mortgage (ARM)     4121
                         Conventional fixed mortgage                9937
                         FHA mortgage                               4577
                         Home equity loan or line of credit         2103
                         Other mortgage                            18028
                         Reverse mortgage                            102
                         Second mortgage                             148
                         VA mortgage                                 513
Other financial service  Check cashing                                31
                         Debt settlement                               3
                         Foreign currency exchange                    10
                         Money order                                   2
                         Refund anticipation check                     9
                         Traveler’s/Cashier’s checks                  11
Payday loan              Payday loan                                  14
Prepaid card             General purpose card                         16
                         Gift or merchant card                         5
                         Government benefit payment card              19
                         ID prepaid card                               1
                         Mobile wallet                                 1
                         Other special purpose card                    6
                         Payroll card                                  4
Student loan             Federal student loan servicing                9
                         Non-federal student loan                     89
dtype: int64

In [33]:
boa.groupby(['Issue', 'Sub-issue']).size()


Out[33]:
Issue                                     Sub-issue                               
Applied for loan/did not receive money    Applied for loan/did not receive money        1
Can't contact lender                      Can't contact lender                          4
Can't repay my loan                       Can't decrease my monthly payments            5
                                          Can't get flexible payment options            7
                                          Can't temporarily postpone payments           4
Charged fees or interest I didn't expect  Charged fees or interest I didn't expect      4
Communication tactics                     Called after sent written cease of comm      17
                                          Called outside of 8am-9pm                     9
                                          Frequent or repeated calls                  128
                                          Threatened to take legal action              48
                                          Used obscene/profane/abusive language         4
Cont'd attempts collect debt not owed     Debt is not mine                            266
                                          Debt resulted from identity theft            50
                                          Debt was discharged in bankruptcy            76
                                          Debt was paid                               173
Credit monitoring or identity protection  Problem cancelling or closing account         2
Credit reporting company's investigation  Investigation took too long                   1
Dealing with my lender or servicer        Don't agree with fees charged                 2
                                          Having problems with customer service         5
                                          Keep getting calls about my loan              1
                                          Need information about my balance/terms       8
                                          Received bad information about my loan       12
                                          Trouble with how payments are handled        10
Disclosure verification of debt           Not disclosed as an attempt to collect       18
                                          Not given enough info to verify debt        390
                                          Right to dispute notice not received         51
False statements or representation        Attempted to collect wrong amount            93
                                          Impersonated an attorney or official         12
                                          Indicated committed crime not paying         11
                                          Indicated shouldn't respond to lawsuit        1
Getting a loan                            Can't qualify for a loan                      1
                                          Getting a loan                                3
                                          Qualify for a better loan than offered        1
Improper contact or sharing of info       Contacted employer after asked not to        16
                                          Contacted me after I asked not to            26
                                          Contacted me instead of my attorney           4
                                          Talked to a third party about my debt        54
Improper use of my credit report          Report improperly shared by CRC               8
Incorrect information on credit report    Account status                               61
                                          Account terms                                 5
                                          Information is not mine                      15
                                          Public record                                 1
                                          Reinserted previously deleted info            2
Problems when you are unable to pay       Problems when you are unable to pay          13
Received a loan I didn't apply for        Received a loan I didn't apply for            5
Repaying your loan                        Repaying your loan                           26
Taking/threatening an illegal action      Attempted to/Collected exempt funds          12
                                          Seized/Attempted to seize property           69
                                          Sued w/o proper notification of suit         17
                                          Sued where didn't live/sign for debt          4
                                          Threatened arrest/jail if do not pay          9
                                          Threatened to sue on too old debt            40
dtype: int64

In [40]:
complaints.groupby(['Issue', 'Sub-issue']).size()


Out[40]:
Issue                                     Sub-issue                               
Applied for loan/did not receive money    Applied for loan/did not receive money        302
Can't contact lender                      Can't contact lender                          963
Can't repay my loan                       Can't decrease my monthly payments           3600
                                          Can't get flexible payment options           3003
                                          Can't temporarily postpone payments          1315
Can't stop charges to bank account        Can't stop charges to bank account            482
Charged bank acct wrong day or amt        Charged bank acct wrong day or amt            275
Charged fees or interest I didn't expect  Charged fees or interest I didn't expect     2345
Communication tactics                     Called after sent written cease of comm      1786
                                          Called outside of 8am-9pm                     869
                                          Frequent or repeated calls                  14071
                                          Threatened to take legal action              4517
                                          Used obscene/profane/abusive language        1749
Cont'd attempts collect debt not owed     Debt is not mine                            34814
                                          Debt resulted from identity theft            4562
                                          Debt was discharged in bankruptcy            2301
                                          Debt was paid                               15690
Credit monitoring or identity protection  Account terms and changes                     689
                                          Billing dispute                               847
                                          Insurance terms                                 4
                                          Problem cancelling or closing account         466
                                          Problem with fraud alerts                    2002
                                          Receiving unwanted marketing/advertising      205
Credit reporting company's investigation  Inadequate help over the phone               1608
                                          Investigation took too long                  2535
                                          No notice of investigation status/result     5946
                                          Problem with statement of dispute            5548
Dealing with my lender or servicer        Don't agree with fees charged                2380
                                          Having problems with customer service        2455
                                          Keep getting calls about my loan             1145
                                                                                      ...  
False statements or representation        Indicated committed crime not paying          967
                                          Indicated shouldn't respond to lawsuit        332
Getting a loan                            Can't qualify for a loan                      286
                                          Getting a loan                                205
                                          Qualify for a better loan than offered        148
Improper contact or sharing of info       Contacted employer after asked not to        2119
                                          Contacted me after I asked not to            2494
                                          Contacted me instead of my attorney           237
                                          Talked to a third party about my debt        4766
Improper use of my credit report          Received marketing offer after opted out      163
                                          Report improperly shared by CRC              4903
                                          Report shared with employer w/o consent       157
Incorrect information on credit report    Account status                              35338
                                          Account terms                               10418
                                          Information is not mine                     30196
                                          Personal information                         7106
                                          Public record                                8252
                                          Reinserted previously deleted info           5339
Payment to acct not credited              Payment to acct not credited                  356
Problems when you are unable to pay       Problems when you are unable to pay          1697
Received a loan I didn't apply for        Received a loan I didn't apply for            561
Repaying your loan                        Repaying your loan                           3820
Taking/threatening an illegal action      Attempted to/Collected exempt funds           865
                                          Seized/Attempted to seize property           1108
                                          Sued w/o proper notification of suit         1334
                                          Sued where didn't live/sign for debt          385
                                          Threatened arrest/jail if do not pay         2217
                                          Threatened to sue on too old debt            2602
Unable to get credit report/credit score  Problem getting my free annual report        6282
                                          Problem getting report or credit score       4211
dtype: int64

In [44]:
wrong_debt = complaints[complaints['Sub-issue'] == 'Debt is not mine']
paid_debt = complaints[complaints['Sub-issue'] == 'Debt was paid']

In [43]:
wrong_debt['Company'].value_counts()


Out[43]:
Encore Capital Group                               1965
ERC                                                1477
Portfolio Recovery Associates, Inc.                1158
Convergent Resources, Inc.                          774
Afni, Inc.                                          577
Transworld Systems Inc.                             541
Resurgent Capital Services L.P.                     496
Diversified Consultants, Inc.                       479
Citibank                                            473
Expert Global Solutions, Inc.                       463
Dynamic Recovery Solutions, LLC                     463
Allied Interstate LLC                               434
I.C. System, Inc.                                   433
Synchrony Financial                                 413
EOS Holdings, Inc.                                  409
Navient Solutions, LLC.                             403
Stellar Recovery Inc.                               380
CCS Financial Services, Inc.                        376
Commonwealth Financial Systems, Inc.                357
Capital One                                         340
National Credit Systems,Inc.                        297
JPMorgan Chase & Co.                                295
The CBE Group, Inc.                                 283
Southwest Credit Systems, L.P.                      278
Pinnacle Credit Services, LLC                       276
Receivables Performance Management LLC              275
Bank of America                                     266
First National Collection Bureau, Inc.              251
The CMI Group, Inc.                                 233
Credit Protection Association, L.P.                 216
                                                   ... 
Udren Law Offices, P.C.                               1
Lippman & Reed, PLLC                                  1
Tri-Counties Accounts Adjustment Bureau               1
Superior Adjustment, Inc.                             1
Blackwell, Burns & Pratt                              1
Century Financial Group                               1
Global One Arbitration Inc.                           1
Delta Outsource Group, Inc.                           1
Consumer Recovery Solutions, LLC                      1
Nevada Professional Collections Texas                 1
Man-Data Inc.                                         1
21st Mortgage Corporation                             1
United Credit and Collections Inc.                    1
World Omni Financial Corp.                            1
Credit Bureau of Jamestown, Inc.                      1
J&J Financial Services LLC                            1
First Capital Recovery Inc.                           1
Douglas, Chancellor, Meyers and Associates, LLC       1
Yakima County Credit Service, INC                     1
Economic Recovery Consultants, Inc                    1
Global Lending Services LLC                           1
Brelvis Consulting, LLC                               1
S & S Recovery, Inc.                                  1
N&S Partners                                          1
Brian Kvarfordt                                       1
PRO Consulting Services, Inc.                         1
Bernhardt and Strawser, P.A.                          1
LendingTree, Inc                                      1
Jerold Kaplan Law Office, P.C.                        1
FirstBank of Puerto Rico                              1
Name: Company, dtype: int64

In [45]:
paid_debt['Company'].value_counts()


Out[45]:
Encore Capital Group                           653
ERC                                            460
Portfolio Recovery Associates, Inc.            438
Transworld Systems Inc.                        358
Citibank                                       291
Synchrony Financial                            261
Expert Global Solutions, Inc.                  244
Diversified Consultants, Inc.                  239
Capital One                                    234
Afni, Inc.                                     233
Convergent Resources, Inc.                     211
I.C. System, Inc.                              182
JPMorgan Chase & Co.                           174
Bank of America                                173
Resurgent Capital Services L.P.                169
Commonwealth Financial Systems, Inc.           150
Southwest Credit Systems, L.P.                 132
CCS Financial Services, Inc.                   130
Stellar Recovery Inc.                          121
Tenet HealthCare Corporation                   118
HSBC North America Holdings Inc.               117
EOS Holdings, Inc.                             117
Receivables Performance Management LLC         115
CMRE Financial Services, Inc.                  113
Navient Solutions, LLC.                        109
Dynamic Recovery Solutions, LLC                107
National Credit Systems,Inc.                   106
Wells Fargo & Company                          106
Alorica Inc.                                   105
Allied Interstate LLC                           99
                                              ... 
MicroBilt / PRBC (formerly CL Verify)            1
Nagle & Zaller, PC                               1
Lefkoff, Rubin, Gleason & Russo, P.C.            1
Hood & Stacy, P.A.                               1
Certified Services, Inc.                         1
R & R Collection Service, Inc.                   1
Pollack & Rosen, P.A.                            1
Adsen & Associates, LLC                          1
Credit & Collection Recovery Services, Inc.      1
National Account Services, Inc.                  1
Collection Center Inc                            1
The Law Offices of Erskine and Fleisher          1
MJ Altman Companies, Inc.                        1
BOK Financial Corp                               1
Harris Beach PLLC                                1
Morgan & Pottinger, PSC                          1
Precise Financial Group, LLC                     1
Robinson & Associates                            1
Diverse Financial Enterprises                    1
IBERIABANK                                       1
TFC Credit Corporation of California             1
Worldwide Processing Group, LLC                  1
Regional Credit Solutions                        1
Bayfield Financial, LLC                          1
Money Management International, Inc.             1
Curtwright & Klein, LLC                          1
Revenue Enterprises, LLC                         1
CU Recovery, Inc.                                1
BankUnited                                       1
FirstBank of Puerto Rico                         1
Name: Company, dtype: int64

In [ ]: