-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKPMG Task-1.py
200 lines (68 loc) · 1.82 KB
/
KPMG Task-1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
# In[2]:
get_ipython().system('pip install xlrd')
# In[3]:
df = pd.read_excel('Downloads//KPMG_VI_New_raw_data_update_final (1).xlsx',sheet_name='Transactions')
# In[4]:
df.head()
# In[5]:
df.columns = ['Transaction id','Product id','Customer id','Transaction date','online order','order status','brand','product line','product class','product size','list price','standard cost','product first sold date']
# In[6]:
# The dataset might contain duplicate rows of data, we have to find and remove them
# In[7]:
df.duplicated().sum()
# In[8]:
# The dataset does not contain any duplicate values
# In[9]:
# Checking for incomplete data
# In[10]:
df.isnull()
# In[11]:
df.isnull().sum()
# In[12]:
df = pd.read_excel('Downloads//KPMG_VI_New_raw_data_update_final (1).xlsx',sheet_name='NewCustomerList')
# In[13]:
df.tail()
# In[14]:
df.duplicated().sum()
# In[15]:
df.isnull()
# In[16]:
df.isnull().sum()
# In[17]:
df.gender.value_counts()
# In[18]:
df.owns_car.value_counts()
# In[19]:
df = pd.read_excel('Downloads//KPMG_VI_New_raw_data_update_final (1).xlsx',sheet_name='CustomerDemographic')
# In[20]:
df.head()
# In[21]:
df.duplicated().sum()
# In[22]:
df.isnull().sum()
# In[23]:
df.gender.value_counts()
# In[24]:
df = df.replace(to_replace = ["F","Femal"],value = "Female")
# In[25]:
df = df.replace(to_replace = "M",value = "Male")
# In[26]:
df.head()
# In[27]:
df.owns_car.value_counts()
# In[28]:
df.deceased_indicator.value_counts()
# In[29]:
df = pd.read_excel('Downloads//KPMG_VI_New_raw_data_update_final (1).xlsx',sheet_name='CustomerAddress')
# In[30]:
df.head()
# In[31]:
df.duplicated().sum()
# In[32]:
df.isnull().sum()
# In[33]:
df.country.value_counts()