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.
π Intern: Prinkle Kella | CodeAlpha Data Analytics Internship | June 2026
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.
- 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: 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).
Loaded the Diamonds dataset using Seaborn and conducted an initial health check using:
.info().describe().isnull().sum()
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.
- Plotted a histogram to understand the price distribution.
- Created a countplot to analyze the frequency of diamond cut categories.
- 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.
Generated a correlation heatmap to quantify the linear relationships between numeric variables such as price, carat, depth, table, and dimensions.
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.
Insight: Ideal cut diamonds are the most common in the dataset, followed by Premium and Very Good cuts.
Insight: There is a strong positive relationship between carat weight and price. As carat increases, the price generally increases significantly.
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.
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.
The vast majority of diamonds are priced at the lower end, while extremely expensive diamonds are rare outliers.
The correlation heatmap shows a strong relationship between carat and price. Weight is the primary driver of diamond cost.
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.
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.
git clone https://github.com/PrinkleMahshwari/CodeAlpha_ExploratoryDataAnalysis.gitcd CodeAlpha_ExploratoryDataAnalysispip install -r requirements.txtpython src/eda.pyCodeAlpha_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
This project was completed as part of the CodeAlpha Data Analytics Internship Program.
- Dataset Source: Seaborn Built-in Datasets
- Internship Organization: CodeAlpha
- Repository: CodeAlpha_ExploratoryDataAnalysis
Special thanks to CodeAlpha for providing this internship opportunity and to the open-source Python community for the tools used in this project.
| Resource | Link |
|---|---|
| Internship Organization | CodeAlpha |
| GitHub Repository | CodeAlpha_ExploratoryDataAnalysis |
| GitHub Profile | PrinkleMahshwari |
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
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
As part of the CodeAlpha Internship requirements, a project explanation video has been published on LinkedIn.
Status: Done β
LinkedIn Post Link: View LinkedIn Project Demonstration
| Task | Status |
|---|---|
| Web Scraping | β Completed |
| Exploratory Data Analysis | β Completed |
| Data Visualization | β³ Pending |
| Sentiment Analysis | β³ Pending |
This project was developed for educational purposes and as part of the CodeAlpha Data Analytics Internship Program.
Prinkle Kella
BS Software Engineering Student | Data Analytics Intern
- GitHub: PrinkleMahshwari
- LinkedIn: Project Demonstration Video
- Project: CodeAlpha_ExploratoryDataAnalysis
- Internship: CodeAlpha Data Analytics Internship
Thank you for visiting this repository. Feedback, suggestions, and improvements are always welcome.
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




