How am4n-kxn/customer_behavior_analysis works
Purpose and entry points
This repository is a customer-shopping analytics pipeline: raw CSV data is cleaned and modeled for PostgreSQL analysis, then presented in an executive Power BI dashboard. The primary artifacts are the source dataset at customer_shopping_behavior_data.csv, analysis/ETL notebook at Customer Analysis.ipynb, SQL implementation at customer_behavior_sql_queries.sql, and BI report at Customer Behavior Dashboard.pbix.
Raw data boundary
customer_shopping_behavior_data.csv is the system’s inbound data boundary. It contains the customer shopping behavior records used by every downstream stage. Data quality, missing-value handling, and schema normalization occur before database loading, separating source-file irregularities from relational analytics.
Processing and ETL
Customer Analysis.ipynb is the Python-oriented processing entry point, using Pandas and NumPy per the project description. Its role is to inspect, clean, format, and prepare records for transfer to PostgreSQL. SQLAlchemy and Psycopg2 form the application-to-database integration boundary, targeting a local PostgreSQL server managed through pgAdmin 4.
Relational analytics layer
customer_behavior_sql_queries.sql defines the database-facing analytics layer. It represents the PostgreSQL schema/query boundary used to organize transactional customer behavior data, apply relational structure and indexing, and produce reusable analytical results. PostgreSQL is the durable analytical store between Python ETL and Power BI consumption.
Business metrics and dashboarding
Customer Behavior Dashboard.pbix is the Power BI Desktop delivery layer. It consumes the prepared analytical data and exposes executive-oriented KPIs, DAX measures, conditional formatting, and interactive slicers. Power BI is the final consumer-facing boundary; dashboard filters should drive metric recalculation within the report rather than alter source data.
Primary control and data flow
1. Source records enter from customer_shopping_behavior_data.csv.
2. Customer Analysis.ipynb performs Python-based profiling, cleaning, missing-value treatment, and schema formatting.
3. Prepared data is loaded through SQLAlchemy/Psycopg2 into local PostgreSQL.
4. customer_behavior_sql_queries.sql creates or queries the relational analytical structure.
5. Customer Behavior Dashboard.pbix connects to the modeled data and renders filterable KPI and behavioral analysis views.
Material runtimes and infrastructure
The pipeline spans a Python notebook runtime, a local PostgreSQL database server, pgAdmin 4 for database administration, and Power BI Desktop for reporting. No deployed application service, API, orchestration platform, or cloud infrastructure is represented in the repository.
Main entry points: Customer Behavior Dashboard.pbix Customer behavior dashboard · Customer Analysis.ipynb Customer analysis notebook · customer_shopping_behavior_data.csv Shopping behavior CSV · customer_behavior_sql_queries.sql SQL analytics queries
Components 11
Data preparation
- Shopping behavior CSV · Inbound customer shopping records.
customer_shopping_behavior_data.csv - Customer analysis notebook · Pandas/NumPy processing entry point.
Customer Analysis.ipynb - Cleaning and normalization · Profiles records, treats missing values, and formats schema.
- SQLAlchemy / Psycopg2 · Loads prepared records into PostgreSQL.
Relational analytics
- Local PostgreSQL · Durable relational store between ETL and reporting.
- SQL analytics queries · Defines schema, indexing, and reusable analytics queries.
customer_behavior_sql_queries.sql - Modeled analytics data · Structured customer behavior data for analysis.
- pgAdmin 4 · Administers the local PostgreSQL server.
Executive reporting
- Customer behavior dashboard · Executive-facing report delivery artifact.
Customer Behavior Dashboard.pbix - DAX KPIs and visuals · Calculates executive metrics and behavioral views.
- Interactive slicers · Filters report views without changing source data.
Connections 11
- Shopping behavior CSV → Customer analysis notebook: input
- Customer analysis notebook → Cleaning and normalization: profiles and prepares
- Cleaning and normalization → SQLAlchemy / Psycopg2: prepared records
- SQLAlchemy / Psycopg2 → Local PostgreSQL: loads
- SQL analytics queries → Local PostgreSQL: creates and queries
- Local PostgreSQL → Modeled analytics data: organizes
- pgAdmin 4 → Local PostgreSQL: administers
- Local PostgreSQL → Customer behavior dashboard: data connection
- Modeled analytics data → Customer behavior dashboard: analytical data
- Customer behavior dashboard → DAX KPIs and visuals: defines
- Interactive slicers → DAX KPIs and visuals: recalculates