This project analyzes the Superstore retail dataset to understand customer profitability, product sub-category performance, monthly category-level sales trends, and global market sales patterns. The Python script uses pandas for data preparation and summary analysis, and matplotlib/seaborn to generate visualizations saved to the results/ folder.
The project expects the dataset file to be named:
superstore.csv
Place superstore.csv in the same directory where the script is run.
Original dataset reference
Tableau Software. (n.d.). Sample - Superstore [Data set]. Tableau Public Sample Data. Retrieved June 25, 2026, from https://public.tableau.com/app/learn/sample-data
The analysis was developed and tested using:
- Python Version: 3.13.3
- Platform/OS: macOS-13.7.8-x86_64-i386-64bit-Mach-O
The recommended package versions are provided in requirements.txt.
pip install -r requirements.txtpython superstore_analysis.pyThe script prints summary tables to the console and saves all generated
figures to the results/ folder.
The results/ folder is created automatically by the script.
SuperstoreAnalysis/
├── superstore_analysis.py
├── superstore.csv
├── requirements.txt
├── README.md
└── results/
├── analysis_1_top_10_profitable_customers.png
├── analysis_2_negative_profit_subcategories.png
├── analysis_3_category_sales_trend.png
└── analysis_4_market_subcategory_sales_pattern.png
This analysis calculates each customer's order frequency and total profit. Customers are classified as regular customers when their order frequency is above the median customer order frequency. The analysis also identifies the top 10 most profitable customers.
Generated outputs:
- Printed table of average profit for regular vs. non-regular customers
- Printed table of the top 10 most profitable customers
results/analysis_1_top_10_profitable_customers.png
This analysis summarizes total profit by product sub-category and identifies the five sub-categories with the lowest profit. The visualization highlights which product areas are contributing the least to profitability, including any sub-categories with negative total profit.
Generated outputs:
- Printed table of the five lowest-profit product sub-categories
results/analysis_2_negative_profit_subcategories.png
This analysis converts order dates into monthly periods and summarizes total monthly sales by product category. The line plot shows how sales changed over time across the main product categories.
Generated outputs:
- Monthly sales trend visualization
results/analysis_3_category_sales_trend.png
This analysis summarizes total sales for each product sub-category within each global market. It identifies the top-selling sub-category in each market and uses a heatmap to compare sales patterns across markets.
Generated outputs:
- Printed table of the top-selling sub-category in each market
results/analysis_4_market_subcategory_sales_pattern.png
The script is organized into reusable functions so that outputs from one
analysis can be used by downstream analyses if needed. Each analysis
section has its own #region and #endregion block.
The main workflow is controlled by:
if __name__ == "__main__":
main()This allows the script to be run directly while keeping the functions reusable.
- The script assumes that
superstore.csvis located in the current working directory. - The
results/folder is created automatically if it does not already exist. - All plots are saved as
.pngfiles. - Summary tables are printed to the console.
- The script ends with
# [END]for clear file completion.
Author of this project is Anjali Silva. This project welcomes issues, enhancement requests, and other contributions. To submit an issue, use the GitHub issues page: https://github.com/anjalisilva/SuperstoreAnalysis/issues



