Skip to content

ohusq/Diamond-Price-Analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diamond Price Analysis

This tool performs exploratory data analysis on diamond prices to understand which features (carat, cut, color, clarity) influence the price.

What it does

The script processes the diamonds dataset and:

  1. Loads and inspects the data - Checks shape, data types, missing values, and summary statistics
  2. Cleans and prepares the data - Converts categorical columns to efficient types
  3. Generates visualizations - Creates six key plots saved in the /result/ folder
  4. Performs grouping analysis - Calculates average price and carat by cut and color, and identifies most expensive diamonds
  5. Prints key insights - Summarizes findings in the console

Example Charts

After running the analysis, you will find these charts in the /result/ folder:

Distribution of Diamond Prices

Price distribution

Price vs Carat

Price vs Carat

Average Price by Cut Quality

Average price by cut

Price Distribution by Cut (Boxplot)

Price boxplot by cut

Price vs Carat Colored by Clarity

Price vs carat by clarity

Correlation Matrix

Correlation matrix

How to use

  1. Ensure you have the required dependencies (see Requirements below)
  2. Run the analysis script using uv:
    uv run python diamond_analysis.py
  3. Check the console for summary statistics and insights
  4. Find all generated plots in the /result/ folder

Requirements

This script uses uv for Python package management. Make sure you have uv installed:

curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv run main.py

Dataset used

Generated by the seaborn team.

Input and Output

Input: Built‑in diamonds dataset from seaborn (no external file needed)
Output:

  • Console output: summary statistics, grouped results, and key insights
  • /result/ folder containing six PNG images (as shown above)

About

Portfolio showcase demo

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages