PROJECT TITLE:
E-COMMERCE SALES DATA ANALYSIS USING PYTHON
STUDENT NAME:
AKSHITHA GUPTHA
PROBLEM STATEMENT:
In today's e-commerce industry, businesses handle thousands of sales transactions every day.
Analyzing this large amount of data manually is difficult and can lead to errors. The main
purpose of this project is to analyze sales records and extract useful information such as
revenue, product performance, sales trends, and return rates. By using data analysis
techniques, businesses can better understand customer purchasing patterns and make
informed decisions to improve sales and profitability.
PROJECT OBJECTIVES:
● To load and analyze e-commerce sales data using Python.
● To clean the dataset by checking for missing values and duplicate records.
● To calculate revenue after applying discounts on products.
● To identify the best-selling and highest revenue-generating products.
● To analyze category-wise and monthly sales performance.
● To calculate product return rates and generate meaningful business insights.
DATASET DESCRIPTION:
The dataset used in this project contains information about e-commerce sales transactions. It
includes details such as order ID, product name, category, quantity sold, unit price, discount
percentage, order date, and return status. The dataset was stored in a CSV file named
[Link] and loaded into Google Colab for analysis.
The dataset contains both numerical and categorical data. Numerical columns such as
Quantity and Unit Price were used for revenue calculations, while categorical columns such
as Product Name and Category were used for grouping and comparison. The Date column
was converted into a DateTime format to perform monthly sales analysis.
TOOLS & LIBRARIES USED:
The following tools and libraries were used in this project:
● Python
● Google Colab
● Pandas
● NumPy
● Matplotlib
● CSV File Handling
IMPLEMENTATION STEPS:
First, the required libraries were imported into the Python environment. The dataset was then
loaded from Google Drive using Pandas. After loading the data, the structure of the dataset
was examined by displaying the first few rows, checking the number of rows and columns,
and reviewing the data types.
The dataset was then checked for missing values and duplicate records to ensure data quality.
Duplicate order IDs were removed wherever necessary. Next, a new Revenue column was
created by calculating revenue based on quantity sold, unit price, and discount percentage.
Product-wise and category-wise analyses were performed to identify top-performing products
and categories. Monthly revenue analysis was carried out by extracting month information
from the Date column. A bar chart was generated to visualize product revenue. Finally, return
rates were calculated for each product, and the processed results were exported to a CSV file.
PYTHON CODE EXPLANATION:
The first part of the code imports the required libraries such as Pandas, NumPy, and
Matplotlib. These libraries are essential for data analysis and visualization.
The dataset is loaded from a CSV file and stored in a Pandas DataFrame. The DataFrame
allows efficient handling and analysis of the data.
The code then displays the first five rows of the dataset and provides information about the
number of rows, columns, and data types. This helps in understanding the structure of the
dataset.
A statistical summary is generated using the describe() function. This provides information
such as mean, minimum, maximum, and standard deviation values for numerical columns.
The dataset is checked for missing values to ensure completeness. Duplicate order IDs are
also identified and removed to maintain accuracy.
A Revenue column is created using a formula that considers quantity sold, unit price, and
discount percentage. This allows accurate calculation of revenue generated from each order.
Product analysis is performed by grouping records according to product names and
calculating total quantity sold and total revenue. Similar analysis is conducted for product
categories.
The Date column is converted into DateTime format, and monthly revenue is calculated to
identify sales trends across different months.
A bar chart is generated to visually represent revenue generated by each product.
Visualization makes it easier to compare product performance.
Finally, return rates are calculated for products, and a summary report is exported as a CSV
file for future use.
OUTPUT SCREENSHOTS:
The following screenshots should be included in the report:
● Dataset loaded successfully
● First five rows of the dataset
● DataFrame information output
● Statistical summary output
● Revenue calculation output
● Product analysis report
● Category analysis report
● Monthly revenue report
● Returned items report
● Final product summary report
● CSV export output
VISUALIZATIONS:
The project includes a bar chart showing total revenue generated by each product. This
visualization helps in identifying the products that contribute the most revenue.
Additional visualizations such as pie charts, line charts, and histograms can also be included
to improve data interpretation and presentation.
KEY INSIGHTS:
● Certain products generated significantly more revenue than others.
● The best-selling product contributed the highest overall sales revenue.
● Discounts affected the final revenue generated from sales transactions.
● Some product categories performed better than others in terms of revenue.
● Monthly sales revenue varied across different months.
● Return rates differed from one product to another.
● Products with high return rates may require further investigation.
● Data cleaning improved the accuracy and reliability of the analysis.
CHALLENGES FACED:
One of the challenges faced during the project was handling duplicate order records.
Duplicate entries can affect the accuracy of the analysis, so they were identified and removed
using Pandas functions.
Another challenge was calculating revenue correctly after considering discounts. This was
solved by creating a formula that automatically applies the discount percentage before
calculating revenue.
A further challenge was working with date data for monthly analysis. The issue was resolved
by converting the Date column into a DateTime format, which allowed easy extraction of
month information.
LEARNING OUTCOMES:
Through this project, I learned how to work with real-world datasets using Python. I gained
practical experience in data cleaning, data manipulation, and exploratory data analysis using
Pandas.
I also learned how to calculate business metrics such as revenue, sales performance, and
return rates. The project improved my understanding of data visualization using Matplotlib
and helped me develop problem-solving skills while working with large datasets.
Most importantly, this project gave me hands-on experience in transforming raw data into
meaningful insights that can support business decision-making.
CONCLUSION:
This project successfully analyzed e-commerce sales data using Python and its data analysis
libraries. The dataset was cleaned, processed, and analyzed to generate valuable information
about product performance, category revenue, monthly sales trends, and return rates. The
visualizations made it easier to understand the results and identify key business insights.
Overall, this project demonstrated the importance of data analytics in the e-commerce
industry and provided practical experience in handling, analyzing, and visualizing real-world
data.