Comcast Telecom Consumer - Complaints
Comcast Telecom Consumer - Complaints
In [1]:
#Importing Libraries
import numpy as np
import pandas as pd
%matplotlib inline
Loading Dataset
In [2]:
comcast=pd.read_csv("D:\Data Science\python\project\comcast_telecom_complaints_data\Comcast_telecom_complaints_data.csv")
In [3]:
comcast
Out[3]: Ticket # Customer Complaint Date Date_month_year Time Received Via City State Zip code Status Filing on Behalf of Someone
0 250635 Comcast Cable Internet Speeds 22-04-15 22-Apr-15 3:53:50 PM Customer Care Call Abingdon Maryland 21009 Closed No
1 223441 Payment disappear - service got disconnected 04-08-15 04-Aug-15 10:22:56 AM Internet Acworth Georgia 30102 Closed No
2 242732 Speed and Service 18-04-15 18-Apr-15 9:55:47 AM Internet Acworth Georgia 30101 Closed Yes
3 277946 Comcast Imposed a New Usage Cap of 300GB that ... 05-07-15 05-Jul-15 11:59:35 AM Internet Acworth Georgia 30101 Open Yes
4 307175 Comcast not working and no service to boot 26-05-15 26-May-15 1:25:26 PM Internet Acworth Georgia 30101 Solved No
... ... ... ... ... ... ... ... ... ... ... ...
2219 213550 Service Availability 04-02-15 04-Feb-15 9:13:18 AM Customer Care Call Youngstown Florida 32466 Closed No
2220 318775 Comcast Monthly Billing for Returned Modem 06-02-15 06-Feb-15 1:24:39 PM Customer Care Call Ypsilanti Michigan 48197 Solved No
2221 331188 complaint about comcast 06-09-15 06-Sep-15 5:28:41 PM Internet Ypsilanti Michigan 48197 Solved No
2222 360489 Extremely unsatisfied Comcast customer 23-06-15 23-Jun-15 11:13:30 PM Customer Care Call Ypsilanti Michigan 48197 Solved No
2223 363614 Comcast, Ypsilanti MI Internet Speed 24-06-15 24-Jun-15 10:28:33 PM Customer Care Call Ypsilanti Michigan 48198 Open Yes
In [4]:
comcast.head()
Out[4]: Ticket # Customer Complaint Date Date_month_year Time Received Via City State Zip code Status Filing on Behalf of Someone
0 250635 Comcast Cable Internet Speeds 22-04-15 22-Apr-15 3:53:50 PM Customer Care Call Abingdon Maryland 21009 Closed No
1 223441 Payment disappear - service got disconnected 04-08-15 04-Aug-15 10:22:56 AM Internet Acworth Georgia 30102 Closed No
2 242732 Speed and Service 18-04-15 18-Apr-15 9:55:47 AM Internet Acworth Georgia 30101 Closed Yes
3 277946 Comcast Imposed a New Usage Cap of 300GB that ... 05-07-15 05-Jul-15 11:59:35 AM Internet Acworth Georgia 30101 Open Yes
4 307175 Comcast not working and no service to boot 26-05-15 26-May-15 1:25:26 PM Internet Acworth Georgia 30101 Solved No
In [5]:
comcast.isnull().sum()
Out[5]: Ticket # 0
Customer Complaint 0
Date 0
Date_month_year 0
Time 0
Received Via 0
City 0
State 0
Zip code 0
Status 0
dtype: int64
There are no any NaN value present in Data set
In [6]:
comcast.describe(include="all")
Out[6]: Ticket # Customer Complaint Date Date_month_year Time Received Via City State Zip code Status Filing on Behalf of Someone
count 2224 2224 2224 2224 2224 2224 2224 2224 2224.000000 2224 2224
top 371490 Comcast 24-06-15 24-Jun-15 4:38:27 PM Customer Care Call Atlanta Georgia NaN Solved No
mean NaN NaN NaN NaN NaN NaN NaN NaN 47994.393435 NaN NaN
std NaN NaN NaN NaN NaN NaN NaN NaN 28885.279427 NaN NaN
min NaN NaN NaN NaN NaN NaN NaN NaN 1075.000000 NaN NaN
25% NaN NaN NaN NaN NaN NaN NaN NaN 30056.500000 NaN NaN
50% NaN NaN NaN NaN NaN NaN NaN NaN 37211.000000 NaN NaN
75% NaN NaN NaN NaN NaN NaN NaN NaN 77058.750000 NaN NaN
max NaN NaN NaN NaN NaN NaN NaN NaN 99223.000000 NaN NaN
In [7]:
comcast.shape
In [8]:
comcast=comcast.drop(["Ticket #","Time"],axis=1)
In [9]:
comcast.head(10)
Out[9]: Customer Complaint Date Date_month_year Received Via City State Zip code Status Filing on Behalf of Someone
0 Comcast Cable Internet Speeds 22-04-15 22-Apr-15 Customer Care Call Abingdon Maryland 21009 Closed No
1 Payment disappear - service got disconnected 04-08-15 04-Aug-15 Internet Acworth Georgia 30102 Closed No
2 Speed and Service 18-04-15 18-Apr-15 Internet Acworth Georgia 30101 Closed Yes
3 Comcast Imposed a New Usage Cap of 300GB that ... 05-07-15 05-Jul-15 Internet Acworth Georgia 30101 Open Yes
4 Comcast not working and no service to boot 26-05-15 26-May-15 Internet Acworth Georgia 30101 Solved No
5 ISP Charging for arbitrary data limits with ov... 06-12-15 06-Dec-15 Internet Acworth Georgia 30101 Solved No
6 Throttling service and unreasonable data caps 24-06-15 24-Jun-15 Customer Care Call Acworth Georgia 30101 Pending No
7 Comcast refuses to help troubleshoot and corre... 23-06-15 23-Jun-15 Internet Adrian Michigan 49221 Solved No
8 Comcast extended outages 06-01-15 06-Jan-15 Customer Care Call Alameda California 94502 Closed No
9 Comcast Raising Prices and Not Being Available... 28-06-15 28-Jun-15 Customer Care Call Alameda California 94501 Open Yes
Task-1 Provide the trend chart for the number of complaints at monthly and daily granularity levels.
In [10]:
#pandas to datetime() method helps to connvert string Date time into python date time object
comcast["Date_month_year"]=comcast["Date_month_year"].apply(pd.to_datetime)
In [11]:
comcast
Out[11]: Customer Complaint Date Date_month_year Received Via City State Zip code Status Filing on Behalf of Someone
0 Comcast Cable Internet Speeds 22-04-15 2015-04-22 Customer Care Call Abingdon Maryland 21009 Closed No
1 Payment disappear - service got disconnected 04-08-15 2015-08-04 Internet Acworth Georgia 30102 Closed No
2 Speed and Service 18-04-15 2015-04-18 Internet Acworth Georgia 30101 Closed Yes
3 Comcast Imposed a New Usage Cap of 300GB that ... 05-07-15 2015-07-05 Internet Acworth Georgia 30101 Open Yes
4 Comcast not working and no service to boot 26-05-15 2015-05-26 Internet Acworth Georgia 30101 Solved No
... ... ... ... ... ... ... ... ... ...
2219 Service Availability 04-02-15 2015-02-04 Customer Care Call Youngstown Florida 32466 Closed No
2220 Comcast Monthly Billing for Returned Modem 06-02-15 2015-02-06 Customer Care Call Ypsilanti Michigan 48197 Solved No
2221 complaint about comcast 06-09-15 2015-09-06 Internet Ypsilanti Michigan 48197 Solved No
2222 Extremely unsatisfied Comcast customer 23-06-15 2015-06-23 Customer Care Call Ypsilanti Michigan 48197 Solved No
2223 Comcast, Ypsilanti MI Internet Speed 24-06-15 2015-06-24 Customer Care Call Ypsilanti Michigan 48198 Open Yes
In [12]:
#setting 'Date_month_year' as index
comcast=comcast.set_index('Date_month_year')
In [13]:
comcast
Out[13]: Customer Complaint Date Received Via City State Zip code Status Filing on Behalf of Someone
Date_month_year
2015-04-22 Comcast Cable Internet Speeds 22-04-15 Customer Care Call Abingdon Maryland 21009 Closed No
2015-08-04 Payment disappear - service got disconnected 04-08-15 Internet Acworth Georgia 30102 Closed No
2015-04-18 Speed and Service 18-04-15 Internet Acworth Georgia 30101 Closed Yes
2015-07-05 Comcast Imposed a New Usage Cap of 300GB that ... 05-07-15 Internet Acworth Georgia 30101 Open Yes
2015-05-26 Comcast not working and no service to boot 26-05-15 Internet Acworth Georgia 30101 Solved No
2015-02-04 Service Availability 04-02-15 Customer Care Call Youngstown Florida 32466 Closed No
2015-02-06 Comcast Monthly Billing for Returned Modem 06-02-15 Customer Care Call Ypsilanti Michigan 48197 Solved No
2015-09-06 complaint about comcast 06-09-15 Internet Ypsilanti Michigan 48197 Solved No
2015-06-23 Extremely unsatisfied Comcast customer 23-06-15 Customer Care Call Ypsilanti Michigan 48197 Solved No
2015-06-24 Comcast, Ypsilanti MI Internet Speed 24-06-15 Customer Care Call Ypsilanti Michigan 48198 Open Yes
In [17]:
#dataframe.groupby() function is splitting the date into groups according to frequency
months=comcast.groupby(pd.Grouper(freq="M")).size().plot()
plt.xlabel("MONTHS")
plt.ylabel("FREQUENCY")
INSIGHTS:-From the above trend chart,we can clearly see that compliants for the month of June 2015 are maximun
In [19]:
#value_counts function is getting a Series containing counts of unique values for Date column.
comcast["Date"].value_counts()[:8]
23-06-15 190
25-06-15 98
26-06-15 55
30-06-15 53
29-06-15 51
18-06-15 47
06-12-15 43
In [21]:
comcast=comcast.sort_values(by="Date")
In [22]:
comcast
Out[22]: Customer Complaint Date Received Via City State Zip code Status Filing on Behalf of Someone
Date_month_year
2015-01-04 Fraudulent claims reported to collections agency 04-01-15 Customer Care Call Atlanta Georgia 30312 Closed No
2015-01-04 Comcast refusal of service 04-01-15 Customer Care Call Wayne Pennsylvania 19087 Closed No
2015-05-31 Comcast 31-05-15 Customer Care Call Beaverton Oregon 97006 Pending No
2015-05-31 Comcast of East Windsor NJ Complaint 31-05-15 Internet East Windsor New Jersey 8520 Pending No
2015-05-31 n/a (b) (6) 31-05-15 Internet Loganville Georgia 30052 Pending No
2015-05-31 Complaint against Comcast for incredibly bad s... 31-05-15 Customer Care Call Edgewood Washington 98372 Pending No
2015-05-31 Questionable internet slowdown 31-05-15 Customer Care Call Peabody Massachusetts 1960 Solved No
In [29]:
plt.figure(figsize=(6,6))
comcast["Date"].value_counts().plot()
plt.xlabel("DATE")
plt.ylabel("FREQUENCY")
plt.show()
In [31]:
comcast["Customer Complaint"].value_counts(dropna=False)[:9]
Out[31]: Comcast 83
Comcast Internet 18
comcast 13
Data Caps 11
Comcast Billing 11
Comcast/Xfinity 8
In [38]:
comcast["Customer Complaint"].value_counts(dropna=False)[:9].plot.bar()
Out[38]: <AxesSubplot:>
Task 3-Which complaint types are maximum i.e., around internet, network issues, or across any other domains.
In [40]:
internet_issues1=comcast[comcast['Customer Complaint'].str.contains("networks")].count()
In [41]:
internet_issues1
Date 0
Received Via 0
City 0
State 0
Zip code 0
Status 0
dtype: int64
In [44]:
internet_issues2=comcast[comcast["Customer Complaint"].str.contains("speed")].count()
In [45]:
internet_issues2
Date 114
City 114
State 114
Status 114
dtype: int64
In [47]:
internet_issues3=comcast[comcast["Customer Complaint"].str.contains("data")].count()
In [48]:
internet_issues3
Date 64
Received Via 64
City 64
State 64
Zip code 64
Status 64
dtype: int64
In [49]:
internet_issues4=comcast[comcast["Customer Complaint"].str.contains("internet")].count()
In [50]:
internet_issues4
Date 195
City 195
State 195
Status 195
dtype: int64
In [51]:
billing_issues1=comcast[comcast['Customer Complaint'].str.contains("bill")].count()
In [53]:
billing_issues1
Date 184
City 184
State 184
Status 184
dtype: int64
In [57]:
billing_issues2=comcast[comcast['Customer Complaint'].str.contains("billing")].count()
In [58]:
billing_issues2
Date 126
City 126
State 126
Status 126
dtype: int64
In [59]:
billing_issues3=comcast[comcast["Customer Complaint"].str.contains('charges')].count()
In [60]:
billing_issues3
Date 43
Received Via 43
City 43
State 43
Zip code 43
Status 43
dtype: int64
In [62]:
service_issues1=comcast[comcast["Customer Complaint"].str.contains("service")].count()
In [63]:
service_issues1
Date 310
City 310
State 310
Status 310
dtype: int64
In [64]:
service_issues2=comcast[comcast["Customer Complaint"].str.contains("customer")].count()
In [65]:
service_issues2
Date 50
Received Via 50
City 50
State 50
Zip code 50
Status 50
dtype: int64
In [66]:
total_internet_issues=internet_issues1+internet_issues2+internet_issues3+internet_issues4
In [67]:
total_internet_issues
Date 373
City 373
State 373
Status 373
dtype: int64
In [68]:
total_billing_issues=billing_issues1+billing_issues2+billing_issues3
total_billing_issues
Date 353
City 353
State 353
Status 353
dtype: int64
In [69]:
total_service_issues=service_issues1+service_issues2
total_service_issues
Date 360
City 360
State 360
Status 360
dtype: int64
In [70]:
other_issues=2224-(total_internet_issues+total_billing_issues+total_service_issues)
other_issues
Date 1138
City 1138
State 1138
Status 1138
dtype: int64
INSIGHTS:- From the above analysis we can see that the other issues are maximum.
task4=Create a new categorical variable with value as Open and Closed. Open & Pending is to be categorized as Open and Closed & Solved is to be categorized as Closed.
In [71]:
comcast.Status.unique()
In [72]:
comcast["newStatus"]=["Open" if Status=="Open" or Status=="Pending" else "Closed" for Status in comcast["Status"]]
In [73]:
comcast
Out[73]: Customer Complaint Date Received Via City State Zip code Status Filing on Behalf of Someone newStatus
Date_month_year
2015-01-04 Fraudulent claims reported to collections agency 04-01-15 Customer Care Call Atlanta Georgia 30312 Closed No Closed
2015-01-04 Comcast refusal of service 04-01-15 Customer Care Call Wayne Pennsylvania 19087 Closed No Closed
2015-01-04 Comcast Cable 04-01-15 Internet Franklin Tennessee 37067 Closed No Closed
2015-01-04 Data Overages 04-01-15 Internet Savannah Georgia 31406 Closed No Closed
2015-01-04 Comcast 04-01-15 Internet North Huntingdon Pennsylvania 15642 Closed No Closed
... ... ... ... ... ... ... ... ... ...
2015-05-31 Comcast 31-05-15 Customer Care Call Beaverton Oregon 97006 Pending No Open
2015-05-31 Comcast of East Windsor NJ Complaint 31-05-15 Internet East Windsor New Jersey 8520 Pending No Open
2015-05-31 n/a (b) (6) 31-05-15 Internet Loganville Georgia 30052 Pending No Open
2015-05-31 Complaint against Comcast for incredibly bad s... 31-05-15 Customer Care Call Edgewood Washington 98372 Pending No Open
2015-05-31 Questionable internet slowdown 31-05-15 Customer Care Call Peabody Massachusetts 1960 Solved No Closed
In [84]:
comcast.groupby(["State"]).size().sort_values(ascending=False)
Out[84]: State
Georgia 288
Florida 240
California 220
Illinois 164
Tennessee 143
Pennsylvania 130
Michigan 115
Washington 98
Colorado 80
Maryland 78
New Jersey 75
Texas 71
Massachusetts 61
Virginia 60
Indiana 59
Oregon 49
Mississippi 39
Minnesota 33
Alabama 26
Utah 22
Arizona 20
South Carolina 18
District Of Columbia 16
New Mexico 15
Louisiana 13
Connecticut 12
New Hampshire 12
Delaware 12
West Virginia 11
Kentucky 7
Arkansas 6
New York 6
Maine 5
Missouri 4
North Carolina 3
Vermont 3
Ohio 3
Kansas 2
District of Columbia 1
Rhode Island 1
Iowa 1
Nevada 1
Montana 1
dtype: int64
INSIGHTS=From this above table ,we can clearly see that Georgia
has maximun complaints
In [98]:
Status_complaints=comcast.groupby(["State","newStatus"]).size().unstack()
In [100…
Status_complaints
State
In [111…
Status_complaints.plot.bar(figsize=(10,10),stacked=True)
plt.xlabel("State",fontweight="bold",fontsize=15)
INSIGHTS=From this above chart ,we can clearly see that Georgia has maximun complaints
In [112…
comcast["newStatus"].value_counts()
Open 517
In [126…
unresolved_data=comcast.groupby(["State","newStatus"]).size().unstack().fillna(0).sort_values(by="Open",ascending=False)
In [128…
unresolved_data
State
In [131…
unresolved_data["unresolved_comp_%"]=unresolved_data["Open"]/unresolved_data["Open"].sum()*100
In [132…
unresolved_data
State
In [134…
unresolved_data.plot();
task8=Provide the percentage of complaints resolved till date, which were received through the Internet and customer care calls.
In [141…
resolved_data=comcast.groupby(["Received Via","newStatus"]).size().unstack().fillna(0)
In [142…
resolved_data
Received Via
In [143…
resolved_data["resolved"]=resolved_data["Closed"]/resolved_data["Closed"].sum()*100
In [144…
resolved_data["resolved"]
Internet 49.384886
In [159…
resolved_data.plot.bar()
INSIGHTS:- From the above pie chart we can clearly see that there are total 50.61% Complaints resolved for Customer Care Call and 49.39% for received via internet
In [ ]: