This project analyzes an e-commerce sales dataset using Python to understand sales performance, customer behavior, product performance, geographic markets, order trends, and cancellations.
The analysis uses data cleaning, data manipulation, statistical calculations, and data visualization to generate meaningful business insights.
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Jupyter Notebook
- Microsoft Excel Dataset
The project uses the Online Retail dataset containing transaction-level e-commerce sales data.
- InvoiceNo — Invoice number
- StockCode — Product code
- Description — Product description
- Quantity — Quantity purchased
- InvoiceDate — Date and time of the transaction
- UnitPrice — Price per unit
- CustomerID — Customer identification number
- Country — Customer's country
The analysis aims to answer the following business questions:
- What is the total revenue generated from completed sales?
- What is the average order value?
- Which products generate the highest revenue?
- Which products have the highest quantity sold?
- Which countries generate the highest revenue?
- Which countries have the highest number of orders?
- Which customers contribute the most revenue?
- Which months have the highest number of orders?
- What is the cancellation rate?
- How does product quantity relate to revenue?
| Metric | Result |
|---|---|
| Gross Revenue | £10,619,986.68 |
| Completed Orders | 22,064 |
| Average Order Value | £481.33 |
| Cancelled Orders | 3,836 |
| Cancellation Rate | 14.81% |
| Net Revenue After Cancellations | £9,726,006.95 |
- Monthly revenue trend analysis
- Top 10 products by revenue
- Top 10 products by quantity sold
- Top 10 countries by revenue
- Top 10 countries by number of orders
- Top 10 customers by revenue
- Cancellation and return analysis
- Product quantity vs. revenue analysis
The project follows these major steps:
- Load the e-commerce dataset
- Explore the dataset structure and statistics
- Identify missing values and duplicate records
- Clean and prepare the data
- Create new features such as Revenue and Month
- Analyze overall sales performance
- Analyze monthly revenue and order trends
- Analyze product performance
- Analyze customer revenue contribution
- Analyze country-wise sales and orders
- Analyze cancellations and returns
- Visualize important business metrics
- Generate business insights from the analysis
- Completed sales generated approximately £10.62 million in gross revenue.
- The average order value was approximately £481.33.
- A significant number of transactions were cancelled or returned, resulting in a cancellation rate of approximately 14.81%.
- Monthly analysis helps identify periods with higher sales activity and customer demand.
- Product-level analysis highlights products that contribute significantly to revenue and sales volume.
- Country-level analysis helps identify important geographic markets.
- Customer revenue analysis helps identify high-value customers.
- Product quantity versus revenue analysis helps understand the relationship between sales volume and revenue generation.
- Python 3.x
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Jupyter Notebook
- OpenPyXL
Clone the repository:
git clone <repository-url>Navigate to the project folder:
cd python-sales-analysisInstall the required Python libraries:
pip install pandas numpy matplotlib seaborn jupyter openpyxlOpen the Jupyter Notebook:
jupyter notebookThen open:
notebooks/sales_analysis.ipynb
This project demonstrates how Python can be used to perform end-to-end e-commerce sales data analysis.
The analysis covers data cleaning, feature engineering, sales analysis, customer analysis, product analysis, country-wise analysis, order trends, cancellation analysis, and data visualization.
The insights generated from the dataset can help businesses understand sales performance, customer behavior, product demand, and market trends.
python-sales-analysis/
│
├── data/
│ └── Online Retail.xlsx
│
├── notebooks/
│ └── sales_analysis.ipynb
│
├── visualizations/
│ ├── monthly_revenue.png
│ ├── top_10_products_revenue.png
│ ├── top_10_products_quantity.png
│ ├── top_10_countries_revenue.png
│ ├── top_10_countries_orders.png
│ ├── top_10_customers_revenue.png
│ ├── top_10_months_orders.png
│ └── product_quantity_vs_revenue.png
│
├── test.py
└── README.md
## Author
**Yash Sachin Hole**
B.E. Computer Engineering
Dattakala Group of Institutions Faculty of Engineering
Savitribai Phule Pune University
Interested in Data Analytics and Business Analytics.
## Dataset Source
Dataset: Online Retail Dataset
Source: UCI Machine Learning Repository
The dataset contains transaction-level data from a UK-based online retail
business and is used for educational and analytical purposes.







