Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›’ Amazon Sale Report Data Cleaning & Exploratory Analysis

This project performs data cleaning, KPI computation, and exploratory analysis on a real-world Amazon Retail Sales dataset.
It also includes an Object-Oriented Python class (SalesAnalyzer) encapsulating all analytics logic.

๐Ÿ‘‰ Live Streamlit App: https://assignmentpythonweek1.streamlit.app/


๐Ÿ“‚ Project Structure

๐Ÿ“ Project/
โ”œโ”€โ”€ Amazon Sale Report.csv
โ”œโ”€โ”€ Cleaned_Amazon_Sale_Report.csv
โ”œโ”€โ”€ EDA.ipynb
โ”œโ”€โ”€ Kpi Analysis.ipynb
โ”œโ”€โ”€ SalesAnalyzer.py
โ”œโ”€โ”€ amazon.ipynb
โ”œโ”€โ”€ streamlit_app.py (Streamlit Dashboard)
โ”œโ”€โ”€ outlier_boxplot.png
โ”‚โ”€โ”€monthly_revenue_trend.png
โ”‚โ”€โ”€ category_sales.png
โ”‚โ”€โ”€ top_states_sales.png
โ”‚โ”€โ”€ order_status_distribution.png
โ”‚โ”€โ”€ b2b_vs_b2c.png
โ”‚
โ””โ”€โ”€ README.md

๐ŸŽฏ Project Goals

  • Clean raw retail sales data (missing values, duplicates, formatting issues)
  • Perform type conversion (dates, numeric fields, booleans, categories)
  • Compute key business KPIs:
    • Monthly Revenue
    • Region-wise Sales
    • Profit Margin (%)
    • Average Order Value (AOV)
    • Cancellation Rate
    • Category-wise Sales
    • B2B vs B2C Sales Split
  • Visualize insights using Matplotlib and Plotly
  • Implement an OOP-based SalesAnalyzer class to automate analysis
  • Interactive Streamlit Dashboard for real-time exploration

๐Ÿงน 1. Data Cleaning Summary

Key cleaning operations performed:

โœ” Column Normalization

  • Trimmed column name spaces
  • Dropped index and Unnamed:22

โœ” Datatype Fixes

  • Date โ†’ datetime
  • Amount & Qty โ†’ numeric
  • ship-postal-code โ†’ string
  • B2B โ†’ boolean

โœ” Text Standardization

  • Title case for cities/states
  • Uppercase for sizes
  • Cleaned category names

โœ” Intelligent Missing Value Handling

  • Courier Status โ†’ "Pending"
  • Promotion IDs โ†’ "No Promotion"
  • Currency โ†’ "INR"
  • Fulfilled-by assigned using Fulfilment logic

โœ” Special Logic

Cancelled orders are assigned Amount = 0.

โœ” Final Output

Cleaned dataset saved as: Cleaned_Amazon_Sale_Report.csv


๐Ÿ“Š 2. KPI Analysis

All KPI logic is implemented in SalesAnalyzer.py using OOP.

๐Ÿ“ˆ Monthly Revenue Trend

Monthly Revenue

๐Ÿ—บ Region-wise Sales (Top States)

Top States

๐Ÿท Category-wise Sales Distribution

Category Sales

๐Ÿ‘ฅ B2B vs B2C Comparison

B2B vs B2C

๐Ÿ“ฆ Order Status Distribution

Order Status

โš ๏ธ Outlier Detection (Sale Amount)

Outliers


๐Ÿงฎ 3. Additional KPIs Computed

  • Profit Margin %: Assuming baseline cost = 65% of selling price
  • Average Order Value (AOV): Total Revenue / Number of Orders
  • Cancellation Rate: Percentage of orders marked Cancelled
  • Top Performing Categories: By revenue and quantity
  • Fulfilment Performance: Amazon vs Merchant comparison

๐Ÿง  4. SalesAnalyzer OOP Class

The project includes a full OOP implementation in SalesAnalyzer.py

Features

  • Monthly Revenue Analysis
  • Region Sales Breakdown
  • Average Order Value Calculation
  • Profit Margin Computation
  • Cancellation Rate Analysis
  • Automated Trend Charts
  • Outlier Detection Visualizations

Example Usage

from SalesAnalyzer import SalesAnalyzer
import pandas as pd

df = pd.read_csv("Cleaned_Amazon_Sale_Report.csv")
analyzer = SalesAnalyzer(df)

# Generate comprehensive report
analyzer.generate_report()

# Plot visualizations
analyzer.plot_monthly_revenue()
analyzer.plot_region_sales()
analyzer.plot_categories()
analyzer.plot_outliers()

Here is the completed section for your README, polished and ready to copyโ€“paste, including your Streamlit app link and full details:


๐Ÿ“Š 5. Interactive Streamlit Dashboard

This project includes a fully interactive Streamlit Dashboard where you can explore Amazon Retail Sales visually.

๐Ÿš€ Launch Dashboard Locally

To run the dashboard on your machine:

streamlit run streamlit_app.py

Make sure the required packages are installed:

pip install streamlit pandas numpy matplotlib seaborn plotly pyarrow

๐ŸŒ Live Hosted Dashboard

You can view the hosted version of the dashboard here:

๐Ÿ‘‰ Live Streamlit App: https://assignmentpythonweek1.streamlit.app/

This dashboard includes:

  • ๐Ÿ“ˆ Monthly Revenue Trends
  • ๐Ÿ›’ Category-wise Sales
  • ๐Ÿ—บ Top States by Sales
  • ๐Ÿ‘ฅ B2B vs B2C Split
  • ๐Ÿ“ฆ Order Status Distribution
  • โš ๏ธ Outlier Detection
  • ๐Ÿงน Clean Data Preview
  • ๐Ÿ” Filters for Date, Category, Fulfilment, etc.

All visualizations are interactive and allow you to explore the dataset in depth.


Dashboard Features

  • Overview Tab: Key metrics and monthly trends
  • Regional Analysis: State-wise performance breakdown
  • Product Insights: Category and SKU analysis
  • Deep Dive: Custom filters and detailed exploration
  • AI Insights: Automated recommendations and anomaly detection

๐Ÿ““ 6. Jupyter Notebooks

โœ” EDA.ipynb

Data cleaning + descriptive statistics

โœ” Kpi Analysis.ipynb

KPI computation + visualizations

โœ” amazon.ipynb

Combined workflow for cleaning + analysis


๐Ÿ”ง 7. Installation & Setup

Clone the repository

git clone https://github.com/satya-blend360/Assignment_Python_Week1.git

Install dependencies

pip install pandas numpy matplotlib seaborn plotly streamlit

Run Jupyter Notebook

jupyter notebook

Open any of the notebooks:

  • EDA.ipynb
  • Kpi Analysis.ipynb
  • amazon.ipynb

Or run Python script

python SalesAnalyzer.py

Launch Streamlit Dashboard

streamlit run app.py

๐Ÿ“ฆ 8. Dataset Information

  • Total Records: 128,971 orders
  • Date Range: April 2022 - March 2023
  • Columns: 26 features including order details, product info, shipping data, and financial metrics
  • Categories: Kurta, Set, Western Dress, Top, and more
  • Geographic Coverage: Multiple states across India

๐Ÿ† 9. Key Findings

  • Top performing state contributes 25%+ of total revenue
  • B2B orders have 40% higher average order value than B2C
  • Peak sales months align with festive seasons
  • Cancellation rate averages around 12-15%
  • Amazon fulfillment shows better delivery success rates

๐Ÿš€ 10. Technologies Used

  • Python 3.12+
  • Pandas: Data manipulation and cleaning
  • NumPy: Numerical computations
  • Matplotlib: Static visualizations
  • Seaborn: Statistical plots
  • Plotly: Interactive charts
  • Streamlit: Web dashboard
  • Jupyter: Interactive notebooks

๐Ÿ Conclusion

This project demonstrates:

โœ… Complete retail data cleaning workflow
โœ… KPI-driven business analytics
โœ… Rich visualizations for decision-making
โœ… Clean and scalable Object-Oriented Python design
โœ… Interactive dashboard for real-time insights
โœ… Professional documentation & reproducible results

Perfect for showcasing Data Engineering, Analytics, and Python Development skills!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages