This project analyzes a synthetic e-commerce transaction dataset containing 1,500 orders recorded throughout 2025.
The objective is to transform raw transaction data into meaningful business insights related to:
- Sales performance
- Profitability
- Product performance
- Category performance
- Customer segments
- Sales channels
- Marketing channels
- Geographic performance
- Order status
- Discounts
- Customer ratings
- Operational performance
The project follows a complete data analytics workflow using Python, from data loading and cleaning to exploratory data analysis, visualization, insights, and business recommendations.
The primary objective is to understand the factors driving e-commerce revenue and profitability and identify opportunities for business improvement.
The analysis aims to answer questions such as:
- Which months generate the highest sales and profit?
- Which product categories contribute the most revenue?
- Which products are the strongest performers?
- Which customer segment is most valuable?
- Which sales channel performs best?
- Which marketing channel generates the most sales?
- Which states and cities contribute the most revenue?
- What proportion of orders are returned or cancelled?
- How do discounts affect profitability?
- How do customer ratings relate to business performance?
The dataset contains 1,500 synthetic e-commerce transactions covering:
January 1, 2025 β December 31, 2025
The dataset includes information about:
- Order ID
- Order Date
- Customer ID
- Category
- Product
- Quantity
- Unit Price
- Discount Percentage
- Discount Amount
- Sales
- Cost
- Profit
- State
- City
- Customer Segment
- Payment Method
- Sales Channel
- Marketing Channel
- Order Status
- Delivery Days
- Customer Rating
Additional analytical features were created during the project.
| Technology | Purpose |
|---|---|
| Python | Data analysis |
| Pandas | Data manipulation and analysis |
| NumPy | Numerical calculations |
| Matplotlib | Data visualization |
| Seaborn | Statistical visualization |
| Jupyter Notebook | Analysis and documentation |
| Git & GitHub | Version control and portfolio |
Raw Dataset
β
Data Loading
β
Data Understanding
β
Data Quality Assessment
β
Data Cleaning
β
Feature Engineering
β
Exploratory Data Analysis
β
Data Visualization
β
Business Insights
β
Business Recommendations
The dataset was checked for common data-quality problems, including:
- Missing values
- Duplicate rows
- Duplicate Order IDs
- Invalid quantities
- Invalid unit prices
- Negative sales
- Negative costs
- Invalid delivery days
- Invalid discount percentages
- Invalid discount amounts
- Date validity
- Financial business-rule consistency
| Check | Result |
|---|---|
| Total Rows | 1,500 |
| Total Columns after Feature Engineering | 28 |
| Missing Values | 0 |
| Duplicate Rows | 0 |
| Duplicate Order IDs | 0 |
| Invalid Quantities | 0 |
| Invalid Unit Prices | 0 |
| Negative Sales | 0 |
| Negative Costs | 0 |
| Invalid Delivery Days | 0 |
| Invalid Discounts | 0 |
The existing Profit field was retained because profit behavior differs by order status, particularly for returned and cancelled orders. The analysis therefore preserves the original business logic rather than replacing Profit with a simplified Sales β Cost calculation.
The following analytical features were created:
| Feature | Purpose |
|---|---|
| Year | Annual analysis |
| Month | Monthly trend analysis |
| Month_Name | Readable monthly reporting |
| Quarter | Quarterly analysis |
| Day_Name | Day-of-week analysis |
| Profit_Margin | Profitability measurement |
| Discount_Category | Discount-level comparison |
Profit Margin = (Profit / Sales) Γ 100
| KPI | Value |
|---|---|
| π° Total Sales | βΉ10.71 Million |
| π Total Profit | βΉ1.78 Million |
| ποΈ Total Orders | 1,500 |
| π¦ Quantity Sold | 2,240 |
| π§Ύ Average Order Value | βΉ7,140 |
| π Overall Profit Margin | 16.58% |
| π Return Rate | 16.87% |
| β Cancellation Rate | 17.93% |
Electronics generated approximately βΉ7.20 million in sales and βΉ1.16 million in profit, making it the strongest category by both revenue and profitability.
July generated the highest sales and highest profit during 2025, indicating strong performance during this period.
The Consumer segment generated approximately βΉ6.99 million in sales and βΉ1.06 million in profit from 971 orders.
The Mobile App generated approximately βΉ4.91 million in sales, making it the leading sales channel.
Organic marketing generated approximately βΉ2.83 million in sales, the highest among the analyzed marketing channels.
Festival Sales generated approximately βΉ4.88 lakh in profit, showing that promotional campaigns can be highly profitable when managed effectively.
Rajasthan generated approximately βΉ1.31 million in sales, making it the strongest-performing state in the dataset.
Udaipur generated approximately βΉ7.93 lakh in sales, making it the strongest-performing city.
The dataset contains:
- 978 delivered orders
- 253 returned orders
- 269 cancelled orders
The return rate is approximately 16.87%, while the cancellation rate is approximately 17.93%.
Medium discounts generated the highest total sales and profit, while very high discounts produced the lowest average profit margin.
Rating 4 had the highest number of orders and the highest total sales, followed by rating 5.
The correlation analysis showed strong positive relationships between:
- Sales and Cost
- Unit Price and Cost
- Discount Amount and Sales
- Sales and Profit
The project includes the following visualizations:
Maintain strong inventory availability for high-performing Electronics products and use targeted promotions to maximize their contribution.
Products such as Smart Watch, Smartphone, Laptop, and Headphones should receive priority for inventory planning and promotional campaigns.
The Mobile App is the strongest sales channel. Improvements in personalization, recommendations, user experience, and retention could further increase performance.
Marketing decisions should consider both revenue and profitability. Organic marketing generates strong sales, while Festival Sales demonstrate particularly strong profitability.
The cancellation rate of approximately 17.93% should be investigated. Potential causes could include inventory availability, payment issues, processing delays, or customer expectations.
The return rate of approximately 16.87% indicates an opportunity to investigate return reasons by product, category, location, and customer segment.
Medium discounts produced the strongest combination of sales and profitability in this dataset. Very high discounts should be used selectively.
The Consumer segment is the largest contributor to sales and profit. Loyalty programs, personalized offers, and cross-selling could increase customer value.
High-performing regions such as Rajasthan and Udaipur could be studied to identify similar markets with expansion potential.
Business decisions should consider sales, profit, margin, returns, cancellations, and customer behavior together rather than focusing only on revenue.
E-Commerce-Data-Analysis/
β
βββ data/
β βββ ecommerce_sales_analysis_dataset.csv
β βββ ecommerce_sales_analysis_cleaned.csv
β
βββ notebooks/
β βββ ECommerce_Data_Analysis.ipynb
β
βββ visualizations/
β βββ monthly_sales.png
β βββ category_sales.png
β βββ top_10_products.png
β βββ customer_segments.png
β βββ sales_channels.png
β βββ order_status.png
β βββ discount_profit.png
β βββ correlation_heatmap.png
β
βββ .gitignore
βββ requirements.txt
βββ README.md
git clone <your-github-repository-url>cd E-Commerce-Data-Analysispython -m venv .venv.venv\Scripts\activatesource .venv/bin/activatepip install -r requirements.txtjupyter notebookOpen:
notebooks/ECommerce_Data_Analysis.ipynb
Run the notebook from top to bottom.
This project demonstrates practical Data Analyst skills including:
- Data loading
- Data cleaning
- Data validation
- Feature engineering
- Exploratory Data Analysis
- Aggregation and grouping
- KPI calculation
- Trend analysis
- Product analysis
- Customer segmentation
- Marketing analysis
- Geographic analysis
- Correlation analysis
- Data visualization
- Business insight generation
- Business recommendations
- Python documentation
Tripti Sahu
Aspiring Data Analyst
- Python
- Pandas
- NumPy
- SQL
- Excel
- Power BI
- Data Visualization
- Exploratory Data Analysis
Feel free to explore the notebook and visualizations to understand the complete analytical workflow.







