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

In [2]:
csv_path = "../data/consumer-complaints.csv"
csv_path_out = "../data/consumer-complaints-formatted.csv"

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

In [11]:
complaints[complaints['ZIP code'].notnull()]['ZIP code'].value_counts().to_csv('vals')

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


Out[13]:
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 [ ]: