This project analyzes sales data to identify trends, understand data quality, and prepare the dataset for further analysis and visualization.
The project uses Python and Pandas to load, inspect, and clean the dataset before performing exploratory data analysis.
Dataset: Superstore Sales Dataset
The dataset contains information about:
- Orders
- Customers
- Products
- Sales
- Profit
- Regions
- Shipping details
- Python
- Pandas
- Visual Studio Code
- Clone the repository.
- Open the project folder in Visual Studio Code.
- Create and activate a virtual environment.
- Install the required packages.
pip install pandasCompleted the following tasks:
- Imported the Pandas library.
- Loaded the CSV file into a DataFrame.
- Displayed sample records using
head(). - Displayed all column names.
- Verified column data types.
Performed missing value detection across the entire dataset.
Steps performed:
- Identified missing values using Pandas.
- Counted missing values for each column.
- Filtered columns containing at least one missing value.
- Calculated the percentage of missing values.
- Rounded percentages to two decimal places.
NOTE:
- Replace every value with: Missing? -> True Not Missing? -> False
- Convert: True -> 1 False -> 0
- Add all the 1s in each column Result: Number of missing values per column
| Column | Missing Values | Missing Percentage |
|---|---|---|
| Postal Code | 11 | 0.11% |
The records with missing Postal Codes were examined to verify whether other location information was available. The following fields were still populated:
- City
- State
- Region
The Postal Code column contained 11 missing values, representing 0.11% of the dataset. Since Postal Code is not required for sales trend analysis, product analysis, profit analysis, or regional analysis, the missing values were retained and excluded from any postal code-specific analysis.
Performed a duplicate record check to identify any repeated rows in the dataset.
Reviewed all column data types to ensure they are appropriate for analysis.
Identified that the following date columns were stored as object (string) data types:
- Order Date
- Ship Date
The dataset uses the format:
dd/mm/yyyy
Examples:
08/11/2017
12/06/2017
11/10/2016
Both date columns were converted to datetime format to support time-series analysis and trend calculations.
The following tasks are planned:
- Calculate total sales.
- Calculate monthly sales trends.
- Identify top-selling products.
- Identify top-performing regions.
- Sales by month.
- Sales by category.
- Profit by region.
Generate business insights based on the analysis results.
Sales-Trend-Analysis/
│
├── README.md
├── train.csv
├── data_cleaning.py
├── sales_analysis.py
├── sales_trend_visualization.py
├── main.py
├── visualizations/
│ ├── monthly_sales.png
│ ├── yearly_sales.png
│ ├── category_sales.png
│ └── orders_by_region.png
└── requirements.txt
Project Status: In Progress
Current Phase: Data Cleaning and Preparation