import pandas as pd
df=pd.read_csv("[Link]")
[Link]()
OrderDate OrderID Delivery Date CustomerID Location
Zone \
0 05/31/2020 5136486.0 06/04/2020 230569424 Western
Zone 3
1 05/31/2020 5136457.0 06/12/2020 230568182 Western
Zone 3
2 05/31/2020 5136465.0 06/10/2020 230567584 Weija
Zone 2
3 05/31/2020 5136488.0 06/05/2020 230563788 Greater Accra
Zone 1
4 05/31/2020 5136449.0 06/10/2020 230563726 Weija
Zone 2
Delivery Type Product Category
SubCategory \
0 Express Fashion Girl's
fashion
1 Standard Delivery Health and beauty Medical supplies and
Equipment
2 Standard Delivery Health and beauty Medical supplies and
Equipment
3 Express Phones and Tablet Mobile
phones
4 Shipped from Abroad Fashion Boy's
fashion
Product Unit Price \
0 Fashion Girl's Dress Kids Children Newborn Bab... 125.0
1 Blood Pressure Monitor Digital Wrist BP Pulse ... 63.2
2 Portable Blood Pressure Monitor - White 102.0
3 Samsung A3 Core Dual SIM - 16GB HDD - 1GB RAM ... 387.0
4 Boys Sneakers Casual Kids Sports Shoes-Gold 120.0
Shipping Fee Order Quantity Sale Price Status \
0 10.0 2.0 260.0 Returned
1 4.0 7.0 446.4 Returned
2 6.0 10.0 1026.0 Delivered
3 7.0 7.0 2716.0 Delivered
4 12.0 9.0 1092.0 Delivered
Reason Rating
0 Onsite -Description mismatch 2.0
1 Product - Not fitting expectation 2.0
2 NaN 3.0
3 NaN 1.0
4 NaN 3.0
[Link]
(113000, 17)
[Link]()
<class '[Link]'>
RangeIndex: 113000 entries, 0 to 112999
Data columns (total 17 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 OrderDate 112858 non-null object
1 OrderID 112988 non-null float64
2 Delivery Date 112992 non-null object
3 CustomerID 113000 non-null int64
4 Location 112962 non-null object
5 Zone 109264 non-null object
6 Delivery Type 112996 non-null object
7 Product Category 112995 non-null object
8 SubCategory 112996 non-null object
9 Product 112996 non-null object
10 Unit Price 112970 non-null float64
11 Shipping Fee 112296 non-null float64
12 Order Quantity 112992 non-null float64
13 Sale Price 113000 non-null float64
14 Status 113000 non-null object
15 Reason 29645 non-null object
16 Rating 110860 non-null float64
dtypes: float64(6), int64(1), object(10)
memory usage: 14.7+ MB
[Link]()
OrderID CustomerID Unit Price Shipping Fee \
count 1.129880e+05 1.130000e+05 112970.000000 112296.000000
mean 5.079975e+06 2.305156e+08 297.037432 11.501362
std 3.263277e+04 3.262048e+04 791.247071 5.192122
min 5.023455e+06 2.304591e+08 15.000000 3.000000
25% 5.051713e+06 2.304874e+08 42.000000 7.000000
50% 5.079976e+06 2.305156e+08 75.000000 12.000000
75% 5.108236e+06 2.305439e+08 156.000000 16.000000
max 5.136490e+06 2.305721e+08 4700.000000 20.000000
Order Quantity Sale Price Rating
count 112992.000000 113000.000000 110860.000000
mean 5.334953 949.020329 2.729758
std 2.924391 1447.936678 1.355170
min 1.000000 4.000000 1.000000
25% 3.000000 165.000000 2.000000
50% 5.000000 400.000000 3.000000
75% 8.000000 908.800000 4.000000
max 10.000000 8180.000000 5.000000
[Link]().sum()
OrderDate 142
OrderID 12
Delivery Date 8
CustomerID 0
Location 38
Zone 3736
Delivery Type 4
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
[Link]().mean()*100
OrderDate 0.125664
OrderID 0.010619
Delivery Date 0.007080
CustomerID 0.000000
Location 0.033628
Zone 3.306195
Delivery Type 0.003540
Product Category 0.004425
SubCategory 0.003540
Product 0.003540
Unit Price 0.026549
Shipping Fee 0.623009
Order Quantity 0.007080
Sale Price 0.000000
Status 0.000000
Reason 73.765487
Rating 1.893805
dtype: float64
df['OrderDate'] = df['OrderDate'].fillna(df['OrderDate'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 12
Delivery Date 8
CustomerID 0
Location 38
Zone 3736
Delivery Type 4
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
[Link]().sum()
OrderDate 0
OrderID 12
Delivery Date 8
CustomerID 0
Location 38
Zone 3736
Delivery Type 4
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['OrderID'] = df['OrderID'].fillna(df['OrderID'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 8
CustomerID 0
Location 38
Zone 3736
Delivery Type 4
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
[Link]
Index(['OrderDate', 'OrderID', 'Delivery Date', 'CustomerID',
'Location',
'Zone', 'Delivery Type', 'Product Category', 'SubCategory',
'Product',
'Unit Price', 'Shipping Fee', 'Order Quantity', 'Sale Price',
'Status',
'Reason', 'Rating'],
dtype='object')
df['Delivery Date'] = df['Delivery Date'].fillna(df['Delivery
Date'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 38
Zone 3736
Delivery Type 4
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Location'] = df['Location'].fillna(df['Location'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 3736
Delivery Type 4
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Zone'] = df['Zone'].fillna(df['Zone'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 4
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Delivery Type'] = df['Delivery Type'].fillna(df['Delivery
Type'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 5
SubCategory 4
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['SubCategory'] = df['SubCategory'].fillna(df['SubCategory'].mode()
[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 5
SubCategory 0
Product 4
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Product'] = df['Product'].fillna(df['Product'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 5
SubCategory 0
Product 0
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Product Category'] = df['Product Category'].fillna(df['Product
Category'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 0
SubCategory 0
Product 0
Unit Price 30
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Unit Price'] = df['Unit Price'].fillna(df['Unit Price'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 0
SubCategory 0
Product 0
Unit Price 0
Shipping Fee 704
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Shipping Fee'] = df['Shipping Fee'].fillna(df['Shipping
Fee'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 0
SubCategory 0
Product 0
Unit Price 0
Shipping Fee 0
Order Quantity 8
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Order Quantity'] = df['Order Quantity'].fillna(df['Order
Quantity'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 0
SubCategory 0
Product 0
Unit Price 0
Shipping Fee 0
Order Quantity 0
Sale Price 0
Status 0
Reason 83355
Rating 2140
dtype: int64
df['Reason'] = df['Reason'].fillna(df['Reason'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 0
SubCategory 0
Product 0
Unit Price 0
Shipping Fee 0
Order Quantity 0
Sale Price 0
Status 0
Reason 0
Rating 2140
dtype: int64
df['Rating'] = df['Rating'].fillna(df['Rating'].mode()[0])
[Link]().sum()
OrderDate 0
OrderID 0
Delivery Date 0
CustomerID 0
Location 0
Zone 0
Delivery Type 0
Product Category 0
SubCategory 0
Product 0
Unit Price 0
Shipping Fee 0
Order Quantity 0
Sale Price 0
Status 0
Reason 0
Rating 0
dtype: int64
df.to_csv('[Link]' , index=False)