An end-to-end data analytics project that transforms retail customer shopping data into meaningful business insights using Python, SQL, and Power BI.
This project analyzes customer shopping behavior to understand purchasing patterns, customer preferences, spending trends, and factors that influence purchase decisions.
The project follows a complete data analytics workflow, from loading and exploring raw data to cleaning, SQL-based analysis, interactive dashboard development, and business reporting.
Project Objectives
- Explore and understand customer shopping data.
- Clean and prepare data for reliable analysis.
- Perform exploratory data analysis (EDA) using Python.
- Answer business questions using SQL.
- Build an interactive Power BI dashboard.
- Communicate findings through a report and presentation.
Dataset: Customer Shopping Behavior
The dataset contains customer-level shopping information, including:
- Customer demographics, such as age and gender
- Products purchased and product categories
- Purchase amounts and customer locations
- Product size, color, and season
- Review ratings and shopping preferences
- Other purchasing and customer behavior attributes
Dataset size: 3,900 records and 18 columns.
Dataset file: customer_shopping_behavior.csv
| Tool | Purpose |
|---|---|
| Python | Data analysis and preparation |
| Pandas | Data manipulation and cleaning |
| Jupyter Notebook | Interactive analysis |
| PostgreSQL | Database storage and SQL analysis |
| SQL | Business queries and aggregations |
| SQLAlchemy | Python-to-database connectivity |
| Power BI | Interactive dashboards and visualization |
| Gamma AI | Presentation creation |
| Git & GitHub | Version control and project hosting |
- Load the CSV dataset using Pandas.
- Inspect dataset dimensions, columns, and data types.
- Generate summary statistics.
- Examine missing values, duplicates, and potential data quality issues.
- Handle missing or inconsistent values where necessary.
- Check for duplicate records.
- Validate data types and column values.
- Transform features where required.
- Prepare the dataset for further analysis.
Load the prepared dataset into PostgreSQL using Python and SQLAlchemy.
The database provides a structured environment for querying customer transactions and analyzing purchasing behavior.
Use SQL queries to investigate business questions, including:
- What is the total purchase revenue by gender?
- Which customers used discounts but still spent more than the average purchase amount?
- Which products have the highest average review ratings?
- How do average purchase amounts compare across shipping types?
- What patterns can be identified across customer segments and product categories?
The SQL analysis uses aggregation, filtering, grouping, and other querying techniques to extract useful business insights.
Develop an interactive dashboard to explore customer shopping trends and communicate analytical findings.
The dashboard supports analysis of:
- Customer demographics
- Purchase amounts and spending patterns
- Product categories and preferences
- Customer review ratings
- Seasonal shopping behavior
- Prepare a report documenting the methodology, analysis, key findings, and business recommendations.
- Use Gamma AI to create a presentation that communicates the project's objectives, analytical process, and insights.
The Power BI dashboard provides a visual overview of customer shopping behavior, helping explore purchasing patterns, customer preferences, and spending trends.
Power BI file: customer_behavior_dashboard.pbix
To explore the interactive dashboard, download the Power BI file from this repository and open it using Microsoft Power BI Desktop.
This project demonstrates how raw retail data can be transformed into structured analysis and business intelligence.
The analysis supports:
- Understanding customer purchasing patterns.
- Comparing spending behavior across customer segments.
- Identifying product and category-level trends.
- Evaluating customer ratings and shopping preferences.
- Presenting findings through SQL queries, visualizations, and reports.
The final business findings and recommendations are based on the results obtained from the SQL analysis and Power BI dashboard.
customer_behaviour_analysis/
โ
โโโ customer_shopping_behavior.csv
โโโ Customer_Shopping_Behavior_Analysis.ipynb
โโโ customer_behavior_sql_queries.sql
โโโ customer_behavior_dashboard.pbix
โโโ Customer-Shopping-Behavior-Analysis.pptx
โโโ dashboard - customer analysis.png
โโโ README.md
โโโ LICENSE
Install or configure the following tools:
- Python 3
- Jupyter Notebook
- PostgreSQL
- Power BI Desktop
- Git
git clone https://github.com/kaviyack/customer_behaviour_analysis.git
cd customer_behaviour_analysispython -m pip install pandas sqlalchemy jupyterInstall the PostgreSQL driver:
python -m pip install "psycopg[binary]"python -m notebookOpen Customer_Shopping_Behavior_Analysis.ipynb and execute the notebook cells in order.
- Start your PostgreSQL server.
- Create a database for the project.
- Configure the database connection in the notebook.
- Load the prepared dataset into PostgreSQL.
- Open
customer_behavior_sql_queries.sql. - Execute the queries using pgAdmin or another PostgreSQL client.
Note: Update the database connection settings to match your local PostgreSQL installation. Never commit database passwords or other credentials to GitHub.
- Download
customer_behavior_dashboard.pbixfrom the repository. - Open it in Power BI Desktop.
- Configure the data source and credentials if prompted.
- Explore the available dashboard visualizations.
Open Customer-Shopping-Behavior-Analysis.pptx to review the project presentation.
Gamma AI can also be used to create or refine the presentation and communicate the key findings.
- Python programming and Pandas
- Exploratory data analysis (EDA)
- Data cleaning and preparation
- SQL querying and business analysis
- PostgreSQL database integration
- Data visualization using Power BI
- Business reporting and presentation
- Analytical thinking and problem-solving
- Automate the data ingestion and cleaning workflow.
- Add more business-focused KPIs and dashboard filters.
- Expand customer segmentation and purchasing trend analysis.
- Document database setup and query execution in greater detail.
- Add quantified findings and actionable recommendations.
- Include additional dashboard views for deeper analysis.
Kaviyavarshini C K
GitHub: @kaviyack
This project is licensed under the MIT License. See the LICENSE file for details.
