Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbwreath_still_working #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .ipynb_checkpoints/consumer_complaints.py-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"metadata": {
"name": "",
"signature": "sha256:21862ae223945f844a00202a826b951e06c8448e11998aa7497f95ead81cf950"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": []
}
269 changes: 269 additions & 0 deletions consumer_complaints.py.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
{
"metadata": {
"name": "",
"signature": "sha256:7fa75caa91be8e5ea62068bde1910606efb87948f7d47f37cc7e07c16ca33db9"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%matplotlib inline"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"consumer_complaint = pd.read_csv(\"complaints_dec_2014.csv\")\n",
"consumer_complaint.head()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Complaint ID</th>\n",
" <th>Product</th>\n",
" <th>Sub-product</th>\n",
" <th>Issue</th>\n",
" <th>Sub-issue</th>\n",
" <th>State</th>\n",
" <th>ZIP code</th>\n",
" <th>Submitted via</th>\n",
" <th>Date received</th>\n",
" <th>Date sent to company</th>\n",
" <th>Company</th>\n",
" <th>Company response</th>\n",
" <th>Timely response?</th>\n",
" <th>Consumer disputed?</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td> 1177167</td>\n",
" <td> Debt collection</td>\n",
" <td> NaN</td>\n",
" <td> Cont'd attempts collect debt not owed</td>\n",
" <td> Debt is not mine</td>\n",
" <td> TX</td>\n",
" <td> 77068</td>\n",
" <td> Web</td>\n",
" <td> 12/31/2014</td>\n",
" <td> 12/31/2014</td>\n",
" <td> Ad Astra Recovery Services Inc</td>\n",
" <td> Closed with explanation</td>\n",
" <td> Yes</td>\n",
" <td> NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td> 1177166</td>\n",
" <td> Debt collection</td>\n",
" <td> NaN</td>\n",
" <td> Cont'd attempts collect debt not owed</td>\n",
" <td> Debt is not mine</td>\n",
" <td> TX</td>\n",
" <td> 77068</td>\n",
" <td> Web</td>\n",
" <td> 12/31/2014</td>\n",
" <td> 12/31/2014</td>\n",
" <td> Unique Management Services, Inc</td>\n",
" <td> Closed with explanation</td>\n",
" <td> Yes</td>\n",
" <td> NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td> 1177165</td>\n",
" <td> Debt collection</td>\n",
" <td> NaN</td>\n",
" <td> Cont'd attempts collect debt not owed</td>\n",
" <td> Debt is not mine</td>\n",
" <td> TX</td>\n",
" <td> 77068</td>\n",
" <td> Web</td>\n",
" <td> 12/31/2014</td>\n",
" <td> 12/31/2014</td>\n",
" <td> CL Holdings, LLC</td>\n",
" <td> Closed with monetary relief</td>\n",
" <td> Yes</td>\n",
" <td> NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td> 1177164</td>\n",
" <td> Debt collection</td>\n",
" <td> NaN</td>\n",
" <td> Cont'd attempts collect debt not owed</td>\n",
" <td> Debt is not mine</td>\n",
" <td> TX</td>\n",
" <td> 77068</td>\n",
" <td> Web</td>\n",
" <td> 12/31/2014</td>\n",
" <td> 12/31/2014</td>\n",
" <td> Enhanced Recovery Company, LLC</td>\n",
" <td> Closed with non-monetary relief</td>\n",
" <td> Yes</td>\n",
" <td> NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td> 1177163</td>\n",
" <td> Debt collection</td>\n",
" <td> NaN</td>\n",
" <td> Cont'd attempts collect debt not owed</td>\n",
" <td> Debt is not mine</td>\n",
" <td> TX</td>\n",
" <td> 77068</td>\n",
" <td> Web</td>\n",
" <td> 12/31/2014</td>\n",
" <td> 12/31/2014</td>\n",
" <td> Enhanced Acquisitions, LLC</td>\n",
" <td> Closed with explanation</td>\n",
" <td> Yes</td>\n",
" <td> NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 7,
"text": [
" Complaint ID Product Sub-product \\\n",
"0 1177167 Debt collection NaN \n",
"1 1177166 Debt collection NaN \n",
"2 1177165 Debt collection NaN \n",
"3 1177164 Debt collection NaN \n",
"4 1177163 Debt collection NaN \n",
"\n",
" Issue Sub-issue State ZIP code \\\n",
"0 Cont'd attempts collect debt not owed Debt is not mine TX 77068 \n",
"1 Cont'd attempts collect debt not owed Debt is not mine TX 77068 \n",
"2 Cont'd attempts collect debt not owed Debt is not mine TX 77068 \n",
"3 Cont'd attempts collect debt not owed Debt is not mine TX 77068 \n",
"4 Cont'd attempts collect debt not owed Debt is not mine TX 77068 \n",
"\n",
" Submitted via Date received Date sent to company \\\n",
"0 Web 12/31/2014 12/31/2014 \n",
"1 Web 12/31/2014 12/31/2014 \n",
"2 Web 12/31/2014 12/31/2014 \n",
"3 Web 12/31/2014 12/31/2014 \n",
"4 Web 12/31/2014 12/31/2014 \n",
"\n",
" Company Company response \\\n",
"0 Ad Astra Recovery Services Inc Closed with explanation \n",
"1 Unique Management Services, Inc Closed with explanation \n",
"2 CL Holdings, LLC Closed with monetary relief \n",
"3 Enhanced Recovery Company, LLC Closed with non-monetary relief \n",
"4 Enhanced Acquisitions, LLC Closed with explanation \n",
"\n",
" Timely response? Consumer disputed? \n",
"0 Yes NaN \n",
"1 Yes NaN \n",
"2 Yes NaN \n",
"3 Yes NaN \n",
"4 Yes NaN "
]
}
],
"prompt_number": 7
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#help(consumer_complaint.head)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Help on method head in module pandas.core.generic:\n",
"\n",
"head(n=5) method of pandas.core.frame.DataFrame instance\n",
" Returns first n rows\n",
"\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"consumer_complaint_counts = conusmer_complaint['Product'].value_counts()\n",
"consumer_complaint_counts[:10]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'conusmer_complaint' is not defined",
"output_type": "pyerr",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-26-d2afca25eb74>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mconsumer_complaint_counts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconusmer_complaint\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'Product'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalue_counts\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mconsumer_complaint_counts\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'conusmer_complaint' is not defined"
]
}
],
"prompt_number": 26
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 19
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}