Skip to content

ThisAkshat/Customer-s_Behavior_Analysis

Repository files navigation

Customer Behavior Analysis – Retail Insights Project

🎯 Project Overview

End-to-end customer behavior analysis using Python (Pandas), PostgreSQL, and Power BI. Performed data cleaning, SQL queries, and built an interactive dashboard to uncover retail insights and drive business decisions.


📁 Project Structure

This project follows an end-to-end data pipeline:

  1. Data Cleaning & Transformation (Python - Jupyter Notebook)
  2. Data Analysis & Queries (SQL - PostgreSQL)
  3. Data Visualization (Power BI Dashboard)

🛠️ Tech Stack

  • Python (Pandas for data cleaning)
  • PostgreSQL (Database management & SQL queries)
  • Power BI (Interactive dashboard creation)
  • Jupyter Notebook (For Python code execution)

📊 Data Source

  • File: customer_shopping_behavior.csv
  • Rows: 3900 customer records
  • Columns: 18 features including:
    • Customer demographics (Age, Gender, Location)
    • Purchase details (Item, Category, Amount)
    • Behavioral data (Discount usage, Subscription status, Review ratings)

🔧 What I Did

1. Python Data Cleaning (Jupyter Notebook)

  • Loaded and explored the dataset
  • Handled missing values in review ratings
  • Created new features:
    • Age groups (Young Adult, Adult, Middle-aged, Senior)
    • Purchase frequency in days
  • Cleaned column names and removed duplicate columns
  • Exported clean data to PostgreSQL database

2. SQL Analysis (PostgreSQL)

Created 10+ analytical queries to answer business questions like:

  • Revenue comparison between male and female customers
  • Top products by average review rating
  • Customer segmentation (New, Returning, Loyal)
  • Impact of discounts on purchase behavior
  • Revenue contribution by age groups
  • Subscription status vs spending patterns

3. Power BI Dashboard

Built an interactive dashboard showing:

  • Customer demographics overview
  • Revenue and sales metrics
  • Purchase patterns by category
  • Shipping type preferences
  • Visual breakdowns by age group and gender

📂 Files in this Repository

  • customer_shopping_behavior.ipynb - Python data cleaning notebook
  • Customer_behavior_SQL.sql - All SQL queries used for analysis
  • Customer_Behavior_Dashboard.pbix - Power BI dashboard file
  • customer_shopping_behavior.csv - Original dataset

🚀 How to Run

  1. Install required Python packages:
    pip install pandas sqlalchemy psycopg2-binary
  2. Run the Jupyter notebook for data cleaning
  3. Import the SQL file into PostgreSQL/PgAdmin
  4. Open the Power BI file to view the dashboard

📌 Key Insights

  • Male customers generate higher revenue than female customers
  • Subscribed customers spend more on average
  • Free shipping is most popular but express shipping customers spend more
  • Middle-aged customers contribute most to revenue
  • Discounts significantly impact purchase decisions

📸 Dashboard Screenshots

Customer Behavior Dashboard Overview

Customer Behavior Dashboard
Interactive Power BI dashboard showing customer demographics, purchase patterns, and behavioral insights.


🔗 Connect & Explore

About

"Customer Behavior Analysis – Retail Insights Project" End-to-end customer behavior analysis using Python (Pandas), PostgreSQL, and Power BI. Performed data cleaning, SQL queries, and built interactive dashboard to uncover retail insights and drive business decisions. #DataAnalytics #Python #SQL #PowerBI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors