Skip to content

Customer Shopping Behavior Analysis using Python, SQL, and Power BI. A complete end-to-end data analytics project involving data cleaning, feature engineering, business analysis using PostgreSQL, and interactive dashboard creation in Power BI. Includes actionable insights on customer segments, purchase patterns, and revenue behavior.

Notifications You must be signed in to change notification settings

s3ldc/Customer-Behaviour-Analysis

Repository files navigation

๐Ÿ“Š Customer Shopping Behavior Analysis

An end-to-end data analytics project that explores customer shopping behavior using Python, SQL (MySQL), and Power BI. The goal is to derive insights into spending patterns, customer segments, subscription trends, and product performance to support data-driven business decisions.

๐Ÿ“ Project Overview

This project analyzes 3,900 purchase transactions across multiple product categories. It includes:

  1. Python-based data cleaning & feature engineering
  2. SQL-based business analysis using PostgreSQL
  3. Interactive Power BI dashboard
  4. Actionable business recommendations

๐Ÿงฐ Technologies Used

  1. Python (Pandas, NumPy) Data cleaning, preprocessing, feature engineering
  2. MySQL Business analysis using SQL queries
  3. Power BI Dashboard & data visualization
  4. Jupyter Notebook EDA documentation

๐Ÿ“Š Dataset Summary

  1. Rows: 3,900

  2. Columns: 18

  3. Key Features:

  4. Age, Gender, Location

  5. Item purchased, Category, Purchase amount

  6. Discount applied, Promo code usage

  7. Subscription status

  8. Previous purchase history

  9. Review ratings

  10. Shipping type

  11. Missing Values:

  12. 37 missing values in Review Rating, handled via category-wise median imputation

๐Ÿงน 1. Data Cleaning & Feature Engineering (Python)

Key steps:

  1. Loaded dataset with Pandas and explored structure
  2. Handled missing ratings using median per product category
  3. Standardized column names to snake_case
  4. Created new features: age_group (binned ages) purchase_frequency_days
  5. Checked redundancy between discount_applied and promo_code_used
  6. Loaded cleaned dataset into PostgreSQL for advanced analysis

๐Ÿงฎ 2. SQL Analysis (PostgreSQL)

Used SQL to answer real business questions:

  1. Revenue comparison by gender
  2. Highest-spending customers using discounts
  3. Top 5 products by average review rating
  4. Standard vs. express shipping behavior
  5. Subscribers vs non-subscribers revenue
  6. Products most dependent on discounts
  7. Customer segmentation: New Returning Loyal
  8. Top 3 products in each category
  9. Repeat buyers & subscription correlation
  10. Revenue contribution by age groups

SQL scripts are included in the /sql/ folder.

๐Ÿ“ˆ 3. Power BI Dashboard

  1. The dashboard highlights:
  2. Total revenue & KPIs
  3. Customer segments
  4. Category performance
  5. Discount usage impact
  6. Age group & gender insights
  7. Shipping type comparison
  8. Product ratings overview

A .pbix file is included in the repository.

๐Ÿ’ก Business Insights & Recommendations

  1. Boost subscription programs with exclusive benefits
  2. Reward loyal customers to improve retention
  3. Optimize discount strategy for margin control
  4. Promote top-rated products in campaigns
  5. Target high-value age groups
  6. Encourage express shipping users through incentives

๐Ÿ“‚ Project Structure ๐Ÿ“ฆ Customer-Shopping-Behavior-Analysis โ”‚ โ”œโ”€โ”€ data/ โ”‚ โ””โ”€โ”€ customer_shopping_data.csv โ”‚ โ”œโ”€โ”€ notebooks/ โ”‚ โ””โ”€โ”€ EDA.ipynb โ”‚ โ”œโ”€โ”€ sql/ โ”‚ โ””โ”€โ”€ business_queries.sql โ”‚ โ”œโ”€โ”€ dashboard/ โ”‚ โ””โ”€โ”€ shopping_behavior_dashboard.pbix โ”‚ โ”œโ”€โ”€ images/ โ”‚ โ””โ”€โ”€ dashboard_screenshots.png โ”‚ โ””โ”€โ”€ README.md

๐Ÿš€ How to Run the Project 1๏ธโƒฃ Clone the Repo git clone https://github.com/s3ldc/Customer-Behaviour-Analysis.git

2๏ธโƒฃ Install Dependencies pip install -r requirements.txt

3๏ธโƒฃ Run the Jupyter Notebook jupyter notebook

4๏ธโƒฃ Load Data into MySQL Use the SQL scripts in the /sql/ folder.

5๏ธโƒฃ Open Power BI Dashboard Open the .pbix file from the /dashboard/ folder.

๐Ÿง‘โ€๐Ÿ’ป Author

Sunil Biriya Data Analyst | SQL | Power BI | Python

About

Customer Shopping Behavior Analysis using Python, SQL, and Power BI. A complete end-to-end data analytics project involving data cleaning, feature engineering, business analysis using PostgreSQL, and interactive dashboard creation in Power BI. Includes actionable insights on customer segments, purchase patterns, and revenue behavior.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published