0% found this document useful (0 votes)
23 views5 pages

Customer Purchase Behavior Analysis

Uploaded by

adityapatel9506
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views5 pages

Customer Purchase Behavior Analysis

Uploaded by

adityapatel9506
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Python Case Study

Analyzing Customer Purchase Behavior


(NumPy, Pandas, Matplotlib)

Introduction
Manager of “NEW MART” wants to understand about the purchase pattern and behavior
of a customer. So that, an optimized marketing strategy can be implemented and
improve customer satisfaction. In this case study, NumPy, Pandas and Matplotlib
libraries are used to analyze and visualize the data.
NumPy: Used for numerical computations and array manipulations.
Pandas: Used for data manipulation and analysis.
Matplotlib: Used for data visualization.

Dataset

Total No. of Rows = 100


Total No. of Columns = 5

List of columns :
Customer_ID: Unique identifier for each customer.
Product_ID: Unique identifier for each product.
Purchase_Amount: The amount spent by the customer on a particular product.
Product_Category: The category to which the product belongs.
Date: Date of the purchase.
Sample Dataset : (customer_product.csv)
Customer_ID

Product_ID

Purchase_Amount

Product_Category

Date

68

77.41938374

Fashion

1/1/2023

99

17

106.8161341

Fashion
1/2/2023

89

14

56.13673223

Grocery

1/3/2023

14

16

58.13477971

Electronics

1/4/2023

46

94.28808781

Fashion

1/5/2023

11

93.6080215

Fashion

1/6/2023

Problem Statements

Read customer_product.csv file using Pandas

Print first 10 rows of dataframe

Print no. of rows and columns available in the dataset

Print information of dataset

Print statistical summary of dataset


Check data types of each column

Check any column has missing values or not and if yes, then handle them.

Find out :

Total purchase amount


Average purchase amount
Maximum purchase amount
Minimum purchase amount
Standard Deviation of purchase amount

Purchase Summary – total purchase amount for each product category

Data visualization – Bar chart for total purchase amount by product category

Data visualization – Histogram for purchase amount distribution

Data visualization – Line chart for purchase trends

Data visualization – Pie chart for product categories

Result

Statistical summary and statistical analytics


Total purchase amount for each product category
Customer segments based on purchasing behavior.
Peak times for customer transactions.
Best-selling product categories.

Customer_ID Product_ID Purchase_Amount Product_Category Date


68 7 77.41938 Fashion 1/1/2023
99 17 106.8161 Fashion 1/2/2023
89 14 56.13673 Grocery 1/3/2023
14 16 58.13478 Electronics 1/4/2023
46 4 94.28809 Fashion 1/5/2023
4 11 93.60802 Fashion 1/6/2023
44 5 192.922 Fashion 1/7/2023
97 8 81.76171 Fashion 1/8/2023
4 15 Electronics 1/9/2023
42 1 Electronics 1/10/2023
64 4 164.3777 Grocery 1/11/2023
18 13 168.0259 Grocery 1/12/2023
54 19 192.264 Electronics 1/13/2023
14 14 168.0407 Fashion 1/14/2023
18 14 97.19609 Grocery 1/15/2023
25 4 Grocery 1/16/2023
16 6 Electronics 1/17/2023
9 3 78.04749 Grocery 1/18/2023
50 12 78.61522 Electronics 1/19/2023
16 13 114.3702 Fashion 1/20/2023
42 20 80.68076 Grocery 1/21/2023
49 3 22.41692 Electronics 1/22/2023
28 11 83.71244 Grocery 1/23/2023
21 18 101.9188 Electronics 1/24/2023
31 5 168.6964 Fashion 1/25/2023
90 20 187.1388 Grocery 1/26/2023
42 3 13.38473 Fashion 1/27/2023
75 6 42.27069 Fashion 1/28/2023
8 9 Grocery 1/29/2023
78 20 Fashion 1/30/2023
73 15 71.8095 Electronics 1/31/2023
89 18 79.79557 Grocery 2/1/2023
38 5 197.7066 Grocery 2/2/2023
87 10 40.19113 Fashion 2/3/2023
89 12 43.99117 Fashion 2/4/2023
19 10 73.62727 Electronics 2/5/2023
94 6 129.1841 Grocery 2/6/2023
89 16 67.63371 Fashion 2/7/2023
57 8 32.97225 Electronics 2/8/2023
61 17 198.9514 Electronics 2/9/2023
1 13 138.8407 Grocery 2/10/2023
56 6 169.8525 Grocery 2/11/2023
5 18 111.8615 Electronics 2/12/2023
97 3 137.0246 Grocery 2/13/2023
34 10 152.3337 Electronics 2/14/2023
3 12 198.3782 Electronics 2/15/2023
35 5 81.67489 Grocery 2/16/2023
73 13 164.7027 Grocery 2/17/2023
63 4 135.0434 Electronics 2/18/2023
76 15 197.9547 Grocery 2/19/2023
84 10 56.94589 Grocery 2/20/2023
2 7 132.0255 Electronics 2/21/2023
90 16 131.9259 Fashion 2/22/2023
43 13 135.6659 Electronics 2/23/2023
61 7 78.23583 Fashion 2/24/2023
1 1 164.7367 Grocery 2/25/2023
37 15 180.1398 Grocery 2/26/2023
12 8 30.94063 Grocery 2/27/2023
36 13 169.5301 Electronics 2/28/2023
22 8 26.0568 Fashion 3/1/2023
15 10 79.67499 Electronics 3/2/2023
37 4 197.3178 Electronics 3/3/2023
14 16 23.22497 Fashion 3/4/2023
57 7 138.2263 Electronics 3/5/2023
34 17 67.89802 Grocery 3/6/2023
97 18 158.5421 Electronics 3/7/2023
13 17 181.047 Electronics 3/8/2023
72 6 174.0572 Fashion 3/9/2023
11 14 86.69051 Fashion 3/10/2023
18 3 112.7661 Grocery 3/11/2023
9 14 150.5265 Grocery 3/12/2023
36 11 85.89538 Fashion 3/13/2023
46 10 127.5464 Grocery 3/14/2023
53 13 99.2885 Fashion 3/15/2023
77 17 176.6929 Grocery 3/16/2023
10 20 21.18968 Fashion 3/17/2023
43 8 95.02441 Electronics 3/18/2023
25 13 21.5194 Fashion 3/19/2023
57 6 56.75898 Electronics 3/20/2023
56 12 112.0242 Electronics 3/21/2023
51 18 58.13708 Grocery 3/22/2023
13 5 184.8052 Fashion 3/23/2023
90 3 50.52462 Grocery 3/24/2023
14 1 18.46988 Electronics 3/25/2023
27 18 31.87504 Fashion 3/26/2023
56 1 102.2047 Fashion 3/27/2023
79 8 188.2086 Grocery 3/28/2023
52 15 138.0445 Fashion 3/29/2023
66 12 44.33909 Fashion 3/30/2023
28 3 62.39134 Grocery 3/31/2023
80 7 123.5348 Fashion 4/1/2023
83 1 132.5475 Electronics 4/2/2023
12 14 31.99333 Fashion 4/3/2023
3 6 191.9991 Fashion 4/4/2023
82 9 138.0535 Fashion 4/5/2023
12 18 95.93229 Electronics 4/6/2023
25 15 109.8709 Grocery 4/7/2023
24 16 146.8084 Fashion 4/8/2023
53 5 76.1453 Fashion 4/9/2023
45 13 124.8764 Grocery 4/10/2023

You might also like