Skip to content

PrinkleMahshwari/CodeAlpha_ExploratoryDataAnalysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” CodeAlpha_ExploratoryDataAnalysis

Exploratory Data Analysis (EDA) on the Diamonds dataset for the CodeAlpha Data Analytics Internship. This Python data analytics project uses Pandas, Seaborn, and Matplotlib to uncover trends, patterns, correlations, outliers, and business insights in diamond pricing data through statistical analysis and visualization.

Python Pandas Seaborn Matplotlib CodeAlpha

🌟 Intern: Prinkle Kella | CodeAlpha Data Analytics Internship | June 2026


🎯 Project Objective

The objective of this task was to perform Exploratory Data Analysis (EDA) on a real-world dataset to uncover underlying structures, detect outliers, identify important variables, and test assumptions using statistical graphics.

This project focuses on understanding how different diamond attributes such as carat, cut, color, clarity, depth, table, and dimensions affect diamond pricing.


πŸ› οΈ Tools & Technologies

  • Python 3.12
  • Pandas: Data manipulation, health checks, and cleaning
  • Seaborn: Statistical data visualization using histograms, scatterplots, boxplots, countplots, and heatmaps
  • Matplotlib: Base plotting and chart customization
  • NumPy: Numerical operations

πŸ“Š Dataset Source

  • Dataset: Seaborn Built-in Diamonds Dataset
  • Description: Contains prices and attributes of almost 54,000 diamonds.
  • Features: Carat, Cut, Color, Clarity, Depth, Table, Price, and Dimensions (x, y, z).

βš™οΈ Methodology & Implementation

1. Data Loading & Health Check

Loaded the Diamonds dataset using Seaborn and conducted an initial health check using:

  • .info()
  • .describe()
  • .isnull().sum()

2. Data Cleaning

Identified logical errors where diamond dimensions (x, y, z) were recorded as 0. These 20 invalid rows were removed to maintain data integrity and improve analysis accuracy.

3. Univariate Analysis

  • Plotted a histogram to understand the price distribution.
  • Created a countplot to analyze the frequency of diamond cut categories.

4. Bivariate Analysis

  • Used a scatterplot to observe the relationship between carat and price.
  • Used a boxplot to compare price distributions across different cut qualities and detect outliers.

5. Multivariate Analysis

Generated a correlation heatmap to quantify the linear relationships between numeric variables such as price, carat, depth, table, and dimensions.


πŸ“Έ Output Previews

1. Price Distribution (Histogram)

Price Distribution

Insight: The price distribution is right-skewed. Most diamonds are affordable and fall in the lower price range, while very expensive diamonds appear as rare outliers.


2. Count by Cut Quality (Countplot)

Cut Count

Insight: Ideal cut diamonds are the most common in the dataset, followed by Premium and Very Good cuts.


3. Price vs Carat Weight (Scatterplot)

Carat vs Price

Insight: There is a strong positive relationship between carat weight and price. As carat increases, the price generally increases significantly.


4. Price by Cut Quality (Boxplot)

Price by Cut

Insight: The boxplot shows that each cut category contains several high-price outliers. These outliers are usually larger diamonds where price is heavily influenced by carat weight.


5. Feature Correlation (Heatmap)

Correlation Heatmap

Insight: Carat has the strongest positive correlation with price, making it the most important pricing factor. Diamond dimensions (x, y, z) also show strong correlation with both carat and price.


πŸ’‘ Key Learnings & Insights

Right-Skewed Prices

The vast majority of diamonds are priced at the lower end, while extremely expensive diamonds are rare outliers.

Carat is King

The correlation heatmap shows a strong relationship between carat and price. Weight is the primary driver of diamond cost.

The Cut Paradox

Interestingly, Fair and Good cuts can show higher median prices than Ideal cuts. This happens because large and heavy diamonds may not always receive Ideal cuts, as jewelers often prioritize retaining carat weight over perfect symmetry.

Understanding Outliers

The boxplot revealed many high-price outliers. These outliers are usually diamonds with higher carat weight, which increases price even if the cut quality is not the best.


πŸš€ How to Run Locally

Clone the Repository

git clone https://github.com/PrinkleMahshwari/CodeAlpha_ExploratoryDataAnalysis.git

Navigate to the Project Directory

cd CodeAlpha_ExploratoryDataAnalysis

Install Required Libraries

pip install -r requirements.txt

Run the EDA Script

python src/eda.py

πŸ“‚ Project Structure

CodeAlpha_ExploratoryDataAnalysis/
β”œβ”€β”€ data/                   # Dataset files
β”‚   └── diamonds.csv        # Exported dataset
β”œβ”€β”€ screenshots/            # Output visualizations
β”‚   β”œβ”€β”€ carat_vs_price.png
β”‚   β”œβ”€β”€ correlation_heatmap.png
β”‚   β”œβ”€β”€ cut_count.png
β”‚   β”œβ”€β”€ price_by_cut.png
β”‚   └── price_distribution.png
β”œβ”€β”€ src/                    # Source code directory
β”‚   └── eda.py              # Main EDA script
β”œβ”€β”€ README.md               # Project documentation
└── requirements.txt        # Python dependencies

πŸ™ Acknowledgements

This project was completed as part of the CodeAlpha Data Analytics Internship Program.

Special thanks to CodeAlpha for providing this internship opportunity and to the open-source Python community for the tools used in this project.


πŸ”— Important Links

Resource Link
Internship Organization CodeAlpha
GitHub Repository CodeAlpha_ExploratoryDataAnalysis
GitHub Profile PrinkleMahshwari

πŸ“ˆ Skills Gained

Through this project, I gained practical experience in:

  • Exploratory Data Analysis (EDA)
  • Data Cleaning & Data Preprocessing
  • Statistical Data Analysis
  • Data Visualization
  • Pandas DataFrames
  • Seaborn Visualizations
  • Matplotlib Charts
  • Correlation Analysis
  • Outlier Detection
  • Feature Engineering Understanding
  • Business Insight Extraction
  • Python for Data Analytics
  • Git & GitHub Documentation

πŸš€ Future Improvements

Possible future improvements for this project include:

  • Building Machine Learning models to predict diamond prices
  • Analyzing the impact of Color and Clarity on pricing
  • Creating interactive dashboards using Streamlit
  • Developing Power BI dashboards for business reporting
  • Applying advanced outlier detection techniques such as IQR and Z-Score methods
  • Performing feature importance analysis using machine learning algorithms

πŸŽ₯ LinkedIn Project Demonstration

As part of the CodeAlpha Internship requirements, a project explanation video has been published on LinkedIn.

Status: Done βœ…

⭐ Internship Progress

Task Status
Web Scraping βœ… Completed
Exploratory Data Analysis βœ… Completed
Data Visualization ⏳ Pending
Sentiment Analysis ⏳ Pending

πŸ“œ License

This project was developed for educational purposes and as part of the CodeAlpha Data Analytics Internship Program.


πŸ‘¨β€πŸ’» Author

Prinkle Kella

BS Software Engineering Student | Data Analytics Intern

Thank you for visiting this repository. Feedback, suggestions, and improvements are always welcome.


πŸ”Ž SEO Keywords

Exploratory Data Analysis, EDA Project, Diamonds Dataset, Python Data Analytics, Pandas, Seaborn, Matplotlib, Data Visualization, Correlation Analysis, Outlier Detection, CodeAlpha Internship, Python Project, Data Science Portfolio, Statistical Analysis, Business Intelligence

About

πŸ” Exploratory Data Analysis on Amazon Bestselling Books (2009-2019) for CodeAlpha Internship. Uncovering trends in pricing, ratings, and genres using Python, Pandas, and Seaborn.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages