lab task 9.ipynb - Colab
lab task 9.ipynb - Colab
ds= pd.read_csv('/content/shopping_trends.csv')
ds
Purchase
Customer Item Review Subscription Payment Shipp
Age Gender Category Amount Location Size Color Season
ID Purchased Rating Status Method T
(USD)
Credit
0 1 55 Male Blouse Clothing 53 Kentucky L Gray Winter 3.1 Yes Expr
Card
Bank
1 2 19 Male Sweater Clothing 64 Maine L Maroon Winter 3.1 Yes Expr
Transfer
F
2 3 50 Male Jeans Clothing 73 Massachusetts S Maroon Spring 3.1 Yes Cash
Shipp
Next
3 4 21 Male Sandals Footwear 90 Rhode Island M Maroon Spring 3.5 Yes PayPal
F
4 5 45 Male Blouse Clothing 49 Oregon M Turquoise Spring 2.7 Yes Cash
Shipp
... ... ... ... ... ... ... ... ... ... ... ... ... ...
2-
3895 3896 40 Female Hoodie Clothing 28 Virginia L Turquoise Summer 4.2 No Cash
Shipp
S
3896 3897 52 Female Backpack Accessories 49 Iowa L White Spring 4.5 No PayPal
Pic
Credit
3897 3898 46 Female Belt Accessories 33 New Jersey L Green Spring 2.9 No Stand
Card
3898 3899 44 Female Shoes Footwear 77 Minnesota S Brown Summer 3.8 No PayPal Expr
Bank S
3899 3900 52 Female Handbag Accessories 81 California M Beige Spring 3.1 No
Transfer Pic
ds.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 3900 entries, 0 to 3899
Data columns (total 19 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Customer ID 3900 non-null int64
1 Age 3900 non-null int64
2 Gender 3900 non-null object
3 Item Purchased 3900 non-null object
4 Category 3900 non-null object
5 Purchase Amount (USD) 3900 non-null int64
6 Location 3900 non-null object
7 Size 3900 non-null object
8 Color 3900 non-null object
9 Season 3900 non-null object
10 Review Rating 3900 non-null float64
11 Subscription Status 3900 non-null object
12 Payment Method 3900 non-null object
13 Shipping Type 3900 non-null object
14 Discount Applied 3900 non-null object
15 Promo Code Used 3900 non-null object
16 Previous Purchases 3900 non-null int64
17 Preferred Payment Method 3900 non-null object
18 Frequency of Purchases 3900 non-null object
dtypes: float64(1), int64(4), object(14)
memory usage: 579.0+ KB
ds.isnull()
Purchase
Customer Item Review Subscription Payment Shipping Disc
Age Gender Category Amount Location Size Color Season
ID Purchased Rating Status Method Type App
(USD)
0 False False False False False False False False False False False False False False
1 False False False False False False False False False False False False False False
2 False False False False False False False False False False False False False False
3 False False False False False False False False False False False False False False
4 False False False False False False False False False False False False False False
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
3895 False False False False False False False False False False False False False False
3896 False False False False False False False False False False False False False False
3897 False False False False False False False False False False False False False False
3898 False False False False False False False False False False False False False False
3899 False False False False False False False False False False False False False False
ds.size
74100
ds.tail()
Purchase
Customer Item Review Subscription Payment Shipping
Age Gender Category Amount Location Size Color Season
ID Purchased Rating Status Method Type
(USD)
2-Day
3895 3896 40 Female Hoodie Clothing 28 Virginia L Turquoise Summer 4.2 No Cash
Shipping
Store
3896 3897 52 Female Backpack Accessories 49 Iowa L White Spring 4.5 No PayPal
Pickup
New Credit
3897 3898 46 Female Belt Accessories 33 L Green Spring 2.9 No Standard
Jersey Card
3898 3899 44 Female Shoes Footwear 77 Minnesota S Brown Summer 3.8 No PayPal Express
Bank Store
3899 3900 52 Female Handbag Accessories 81 California M Beige Spring 3.1 No
Transfer Pickup
0 True
1 True
2 True
3 True
4 True
... ...
3895 True
3896 True
3897 True
3898 True
3899 True
dtype: bool
ds.isnull().sum()
0
Customer ID 0
Age 0
Gender 0
Item Purchased 0
Category 0
Location 0
Size 0
Color 0
Season 0
Review Rating 0
Subscription Status 0
Payment Method 0
Shipping Type 0
Discount Applied 0
Previous Purchases 0
Frequency of Purchases 0
dtype: int64
ds.shape
(3900, 19)
0 53
1 64
2 73
3 90
4 49
... ...
3895 28
3896 49
3897 33
3898 77
3899 81
dtype: int64
0 53
1 64
2 73
3 90
4 49
... ...
3895 28
3896 49
3897 33
3898 77
3899 81
dtype: int64
a=ds['Review Rating'].value_counts()
a.plot(kind='bar')