Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

🛒 E-Commerce Customer Data Cleaning & EDA Project

📌 Project Overview

This project performs end-to-end data cleaning, exploratory data analysis (EDA), visualization, and data transformation on a messy e-commerce sales dataset using Python. The goal is to take raw, inconsistent data and turn it into a clean, analysis-ready dataset while uncovering key patterns in customer purchasing behavior.

🎯 Objective

To clean and analyze an E-commerce Customer dataset using Python and perform Exploratory Data Analysis (EDA) to extract meaningful business insights.

📂 Dataset

  • Input file: messy_ecommerce_sales_data.csv
  • Output file: Cleaned_Ecommerce_Data.csv (generated after cleaning)
  • Columns: ID, Customer_Name, Order_ID, Order_Date, Product, Category, Quantity, Price, Payment_Method, Status, Total

Note: If the raw dataset isn't your own to redistribute, consider linking to its original source instead of uploading it directly.

🧹 Data Cleaning Steps

Each column was cleaned individually following an identify → solve → verify workflow:

Column Issues Found Fix Applied
ID Duplicate values Removed duplicate rows
Customer_Name Duplicate values Removed duplicate rows
Order_ID None No cleaning needed
Order_Date Invalid formats, missing values Converted to datetime, filled missing with mode, standardized format (dd-mm-yyyy)
Product Inconsistent casing Converted to title case
Category Inconsistent casing, spelling variants, missing values Standardized text, merged spelling variants (e.g. "Electronic" → "Electronics"), filled missing with mode
Quantity Invalid/negative values Converted to numeric, replaced negatives with NaN, filled missing with mode
Price Currency symbols, invalid/negative values, outlier Removed $ symbol, converted to numeric, replaced negatives with NaN, filled missing with median, removed outlier row (price = 10000)
Payment_Method None No cleaning needed
Status None No cleaning needed
Total Negative values, missing values Replaced negatives with NaN, filled missing with median

📊 Exploratory Data Analysis & Visualization

The following visualizations were created to explore relationships in the cleaned data:

  • Scatter Plot — Quantity vs Total
  • Bar Chart — Order count by Payment Method
  • Horizontal Bar Chart — Total sales by Payment Method
  • Pie Chart — Order distribution by Category
  • Seaborn Bar Plot — Price by Category and Payment Method
  • Box Plot — Quantity distribution by Category
  • Correlation Heatmap — Price, Quantity, and Total

Key Insights

  • Price and Total show a moderate positive correlation (0.64)
  • Quantity and Total show a moderate positive correlation (0.58)
  • Price and Quantity have a very weak correlation (0.07)
  • Total is mainly driven by both Price and Quantity together

🔄 Data Transformation

  • Label Encoding using sklearn.preprocessing.LabelEncoder
  • One-Hot Encoding using pandas.get_dummies() on Payment_Method and Status columns (with and without drop_first)

🛠️ Tools & Libraries

  • Python 3
  • pandas
  • numpy
  • matplotlib
  • seaborn
  • scikit-learn (LabelEncoder)

🚀 How to Run

  1. Clone this repository
    git clone <your-repo-url>
    cd <repo-folder>
  2. Install dependencies
    pip install pandas numpy matplotlib seaborn scikit-learn
  3. Open the notebook
    jupyter notebook Home_Based_Project.ipynb
    or open it directly in Google Colab.

📁 Project Structure

ecommerce-customer-eda/
│
├── Home_Based_Project.ipynb        # Main notebook (cleaning, EDA, visualization, transformation)
├── data/
│   ├── messy_ecommerce_sales_data.csv    # Raw input dataset (optional to include)
│   └── Cleaned_Ecommerce_Data.csv        # Cleaned output dataset
├── images/                          # (optional) exported chart screenshots for the README
├── README.md
└── requirements.txt                  # Python dependencies

👤 Author

Maira Rehmat ID: AI-817677

📄 License

This project is open source and available for educational use.

About

Data cleaning, EDA, visualization, and transformation on a messy e-commerce sales dataset using Python (pandas, seaborn, matplotlib, scikit-learn).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages