0% found this document useful (0 votes)
28 views8 pages

Supermart Grocery Sales Analysis

Data analysis report

Uploaded by

1js21ec041
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views8 pages

Supermart Grocery Sales Analysis

Data analysis report

Uploaded by

1js21ec041
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Supermart Grocery Sales Analysis

1. Project Objective / Introduction


The primary objective of this project is to analyze Supermart grocery sales data to extract
meaningful insights, trends, and patterns that can inform decision-making in retail operations.

2. Dataset Overview
The dataset is loaded from a CSV file and contains various fields such as Order Date, Sales,
Discount, Profit, and other attributes relevant to sales analytics.

Initial Steps

1. Data Loading: The dataset is loaded using Pandas.


2. Date Conversion: The Order Date column is converted to a datetime format for
temporal analysis.
3. Overview:
o Dataset structure and first five rows are inspected.
o Missing values and summary statistics are evaluated.

Code

python

# Load the dataset


import pandas as pd
import matplotlib.pyplot as plt

file_path = '/content/drive/Othercomputers/My Laptop/Documents/analyst


internship data set/Supermart Grocery Sales - Retail Analytics Dataset.csv'
data = pd.read_csv(file_path)

# Convert 'Order Date' to datetime


data['Order Date'] = pd.to_datetime(data['Order Date'], format='%m/%d/%Y',
errors='coerce')
data['Month-Year'] = data['Order Date'].dt.to_period('M')

# Overview
print(data.info())
print(data.head())

# Missing Values Check


print(data.isnull().sum())

# Summary Statistics
print(data[['Sales', 'Discount', 'Profit']].describe())

3. Analysis and Key Findings


3.1 Sales by Category

Analyzed total sales per product category.

Code

python

# Sales by Category
category_sales = data.groupby('Category')['Sales'].sum()
category_sales.plot(kind='bar', figsize=(8, 5), color='skyblue')
plt.title('Sales by Category')
plt.xlabel('Category')
plt.ylabel('Total Sales')
plt.grid(axis='y', linestyle='--', alpha=0.7)
plt.show()

Findings

 Displays how different categories contribute to total sales.


 Visualized as a bar chart for clarity.
3.2 Profit vs. Discount

Explored the relationship between discounts and profits.

Code

python

# Profit vs Discount
plt.scatter(data['Discount'], data['Profit'], alpha=0.5, c=data['Profit'],
cmap='viridis')
plt.colorbar(label='Profit')
plt.title('Profit vs Discount')
plt.xlabel('Discount')
plt.ylabel('Profit')
plt.grid(True, linestyle='--', alpha=0.7)
plt.show()

Findings

 Scatterplot highlights the influence of discounts on profit margins.


3.3 Monthly Sales Trends

Examined how sales have changed over time on a monthly basis.

Code

python

# Monthly Sales Trend


monthly_sales = data.groupby('Month-Year')['Sales'].sum()
monthly_sales.plot(kind='line', marker='o', figsize=(12, 6), color='orange')
plt.title('Monthly Sales Trend')
plt.xlabel('Month-Year')
plt.ylabel('Sales')
plt.grid(axis='both', linestyle='--', alpha=0.7)
plt.xticks(rotation=45)
plt.show()

Findings

 Line chart shows seasonal variations in sales.

3.4 Regional Sales Distribution

Analyzed the distribution of sales across regions.

Code

python

# Regional Sales Distribution


region_sales = data.groupby('Region')['Sales'].sum()
region_sales.plot(kind='pie', autopct='%1.1f%%', startangle=140,
colors=['skyblue', 'lightgreen', 'orange', 'pink'])
plt.title('Sales Distribution by Region')
plt.ylabel('')
plt.show()

Findings

 Pie chart indicates sales contributions from various regions.

3.5 Top 10 Subcategories by Sales

Identified the subcategories with the highest sales.


Code

python

# Top 10 Subcategories by Sales


subcategory_sales = data.groupby('Sub
Category')['Sales'].sum().sort_values(ascending=False).head(10)
subcategory_sales.plot(kind='bar', figsize=(10, 5), color='purple')
plt.title('Top 10 Subcategories by Sales')
plt.xlabel('Sub Category')
plt.ylabel('Sales')
plt.grid(axis='y', linestyle='--', alpha=0.7)
plt.show()

Findings

 Bar chart showcases the most profitable subcategories.

3.6 State-wise Profit Analysis

Compared profits across states.


Code

python

# State-wise Profit Distribution


state_profit = data.groupby('State')['Profit'].sum().sort_values()
state_profit.plot(kind='barh', figsize=(10, 10), color='coral')
plt.title('State-wise Profit Distribution')
plt.xlabel('Profit')
plt.ylabel('State')
plt.grid(axis='x', linestyle='--', alpha=0.7)
plt.show()

Findings

 Horizontal bar chart ranks states by profitability.

3.7 Correlation Heatmap

Explored relationships between numerical columns.

Code

python

# Correlation Heatmap
numerical_data = data[['Sales', 'Discount', 'Profit']]
correlation_matrix = numerical_data.corr()
plt.matshow(correlation_matrix, cmap='coolwarm', fignum=1)
plt.colorbar()
plt.title('Correlation Matrix', pad=20)
plt.xticks(range(len(correlation_matrix.columns)),
correlation_matrix.columns, rotation=45)
plt.yticks(range(len(correlation_matrix.columns)),
correlation_matrix.columns)
plt.show()

Findings

 Heatmap reveals correlations between sales, discount, and profit.

3.8 Discount Impact on Sales

Analyzed how discounts influence average sales.

Code
python

# Discount Impact on Sales


discount_sales = data.groupby('Discount')['Sales'].mean()
discount_sales.plot(kind='line', figsize=(10, 5), marker='o',
color='darkgreen')
plt.title('Impact of Discount on Average Sales')
plt.xlabel('Discount')
plt.ylabel('Average Sales')
plt.grid(axis='both', linestyle='--', alpha=0.7)
plt.show()

Findings

 Line chart shows optimal discount levels for maximizing sales.

4. Summary of Insights
 Category Sales: Highlights top-performing categories.
 Profit Trends: Discount levels have a non-linear impact on profitability.
 Regional Insights: Some regions dominate sales distribution.
 State Analysis: Certain states show higher profitability, requiring focused strategies.
 Seasonality: Sales trends vary significantly by month.
 Subcategory Trends: Identifies lucrative product subcategories.
5. Conclusion
This analysis provides a comprehensive overview of Supermart’s grocery sales, highlighting
areas for improvement and opportunities for growth.

You might also like