diff --git a/.ipynb_checkpoints/consumer_complaints.py-checkpoint.ipynb b/.ipynb_checkpoints/consumer_complaints.py-checkpoint.ipynb new file mode 100644 index 0000000..3f62bdf --- /dev/null +++ b/.ipynb_checkpoints/consumer_complaints.py-checkpoint.ipynb @@ -0,0 +1,9 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:21862ae223945f844a00202a826b951e06c8448e11998aa7497f95ead81cf950" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [] +} \ No newline at end of file diff --git a/consumer_complaints.py.ipynb b/consumer_complaints.py.ipynb new file mode 100644 index 0000000..feffb56 --- /dev/null +++ b/consumer_complaints.py.ipynb @@ -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": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Complaint IDProductSub-productIssueSub-issueStateZIP codeSubmitted viaDate receivedDate sent to companyCompanyCompany responseTimely response?Consumer disputed?
0 1177167 Debt collection NaN Cont'd attempts collect debt not owed Debt is not mine TX 77068 Web 12/31/2014 12/31/2014 Ad Astra Recovery Services Inc Closed with explanation Yes NaN
1 1177166 Debt collection NaN Cont'd attempts collect debt not owed Debt is not mine TX 77068 Web 12/31/2014 12/31/2014 Unique Management Services, Inc Closed with explanation Yes NaN
2 1177165 Debt collection NaN Cont'd attempts collect debt not owed Debt is not mine TX 77068 Web 12/31/2014 12/31/2014 CL Holdings, LLC Closed with monetary relief Yes NaN
3 1177164 Debt collection NaN Cont'd attempts collect debt not owed Debt is not mine TX 77068 Web 12/31/2014 12/31/2014 Enhanced Recovery Company, LLC Closed with non-monetary relief Yes NaN
4 1177163 Debt collection NaN Cont'd attempts collect debt not owed Debt is not mine TX 77068 Web 12/31/2014 12/31/2014 Enhanced Acquisitions, LLC Closed with explanation Yes NaN
\n", + "
" + ], + "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\u001b[0m in \u001b[0;36m\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": {} + } + ] +} \ No newline at end of file