SAMANTUS Python for Data Analytics — Complete Training Manual CAPSTONE PROJECT 01
← Back to Course Index

Sales Analysis


On This Page

Capstone Project 1: Sales Analysis


C1.1  Project Overview

This capstone project analyzes a full year of retail sales data to uncover trends, top-performing regions and products, and actionable recommendations for the sales team — a portfolio-ready project demonstrating the complete analytics workflow taught in this course.

C1.2  Business Problem

A retail company wants to understand which months, regions, and products are driving the most sales, so they can plan inventory, staffing, and marketing budget more effectively for next year.

C1.3  Dataset Description

ColumnDescription
order_dateDate the order was placed
regionSales region (North, South, East, West)
productProduct name/category
units_soldNumber of units sold in the order
revenueTotal revenue generated by the order

Sample size: 12 months of daily transaction records (~3,000 rows).

C1.4  Objectives


C1.5  Step-by-Step Solution

C1.6  Complete Python Code

► sales_analysis.py
import pandas as pd
import matplotlib.pyplot as plt

# 1. Load data
df = pd.read_csv("sales_data.csv")

# 2. Clean data
df = df.drop_duplicates()
df = df.dropna(subset=["revenue"])

# 3. Prepare dates
df["order_date"] = pd.to_datetime(df["order_date"])
df["month"] = df["order_date"].dt.month_name()

# 4. Aggregate
monthly_sales = df.groupby("month")["units_sold"].sum()
region_sales = df.groupby("region")["revenue"].sum().sort_values(ascending=False)
product_share = df.groupby("product")["revenue"].sum().sort_values(ascending=False)

print("Top Region:", region_sales.index[0])
print("Top Product:", product_share.index[0])

# 5. Visualize
monthly_sales.plot(kind="line", marker="o", title="Monthly Sales Trend")
plt.savefig("monthly_trend.png")

C1.7  Expected Output

Output
Top Region: North
Top Product: Product A

C1.8  Visualizations

Figure C1.1 — Monthly sales trend showing units sold across 2025.
Figure C1.1 — Monthly sales trend showing units sold across 2025.
Figure C1.2 — Total sales revenue by region (Rs. Lakhs).
Figure C1.2 — Total sales revenue by region (Rs. Lakhs).
Figure C1.3 — Product-wise share of total sales revenue.
Figure C1.3 — Product-wise share of total sales revenue.

C1.9  Key Insights

C1.10  Business Recommendations

✓ Instructor Tip
Ask students to present this project as if pitching to the company's Head of Sales — this builds the communication skills that make analysts stand out in interviews.