Chapter 1: Exploratory Data Analysis
๐จ Exploratory Data Analysis (EDA) - A Fun Guide for Everyone!
๐ What is EDA?
Exploratory Data Analysis (EDA) is like being a detective with data! Before solving any mystery (or answering any question with data), you need to understand what youโre working with.
๐ฏ The LEGO Analogy
Imagine you just got a huge box of LEGO blocks! Before building anything cool, youโd want to:
- See what pieces you have - What types of blocks are in the box?
- Sort them by color and size - Organize them into groups
- Count how many of each type - How many red blocks? How many 2x4 pieces?
- Think about what you can build - What patterns do you see? Whatโs possible?
Thatโs exactly what EDA is! But instead of LEGO blocks, weโre exploring data (information/numbers).
๐ Why Do We Need EDA?
EDA helps us:
- Understand our data - What information do we have? Whatโs missing?
- Find patterns - Are there trends or relationships we should know about?
- Spot problems - Are there errors, outliers, or weird values?
- Ask better questions - What interesting things can we discover?
- Make decisions - What insights can help us solve real problems?
Real-world example: Before a doctor treats you, they ask questions, check your temperature, and look at test results. Thatโs EDA! Theyโre exploring your health data before making decisions.
๐ฏ The EDA Journey
๏ฟฝ Python for EDA - Your Data Analysis Toolkit!
Throughout this guide, weโll use Python to analyze data! Python is like a super-powered calculator that can:
- ๐ Create beautiful charts and graphs
- ๐งฎ Calculate statistics automatically
- ๐ Find patterns in large datasets
- ๐พ Work with thousands of data points easily
๐ฆ Essential Python Libraries
# Import the tools we need
import pandas as pd # For working with data tables
import numpy as np # For math and calculations
import matplotlib.pyplot as plt # For creating charts
import seaborn as sns # For beautiful visualizations
# Set up nice-looking plots
plt.style.use('seaborn-v0_8-darkgrid')
sns.set_palette("husl")
What each library does:
- pandas - Think of it as Excel for Python! Works with tables of data
- numpy - Does math really fast, handles numbers and calculations
- matplotlib - Creates all kinds of charts and graphs
- seaborn - Makes matplotlib charts look beautiful and professional
๏ฟฝ Chapter 1: Understanding Variables (Types of Information)
Think of variables like different types of toys in your toy box!
๐ท๏ธ Types of Variables
Types of Information] --> B[Categorical
Categories/Groups] A --> C[Quantitative
Numbers] B --> D[Unordered
No Ranking] B --> E[Ordered
Has Ranking] D --> F[Examples:
๐ Fruit Types
๐จ Colors
๐ Pet Types] E --> G[Examples:
๐ Grades: A,B,C
๐ก๏ธ Temp: Hot,Warm,Cold
๐ Size: S,M,L] C --> H[Examples:
๐ Age
๐ฐ Money
๐ Test Scores] style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style B fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style C fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style D fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff style E fill:#E67E22,stroke:#A04000,stroke-width:3px,color:#fff style F fill:#1ABC9C,stroke:#117A65,stroke-width:3px,color:#fff style G fill:#F39C12,stroke:#B9770E,stroke-width:3px,color:#fff style H fill:#27AE60,stroke:#186A3B,stroke-width:3px,color:#fff
๐ช Real-Life Examples
Unordered Categorical (Like choosing ice cream flavors - no โbestโ order):
- ๐ฆ Ice cream flavors: Chocolate, Vanilla, Strawberry
- ๐จ Favorite colors: Red, Blue, Green
- ๐พ Types of pets: Dog, Cat, Fish
Ordered Categorical (Like video game levels - has order):
- ๐ฎ Game difficulty: Easy โ Medium โ Hard
- ๐ School grades: A โ B โ C โ D
- ๐ก๏ธ Temperature feeling: Cold โ Cool โ Warm โ Hot
Quantitative (Numbers you can count or measure):
- ๐ Your age: 8, 9, 10 years
- ๐ฐ Money in piggy bank: $5, $10, $20
- ๐ Height: 120 cm, 130 cm, 140 cm
๐ Chapter 2: Univariate Analysis (Looking at One Thing at a Time)
Univariate = โUniโ (one) + โvariateโ (variable) = Looking at ONE variable
What is Univariate Analysis?
Univariate analysis means studying one thing at a time. Before looking at how things relate to each other, we first need to understand each thing individually.
Think of it like this:
- Before comparing how tall different trees are, first measure each tree
- Before seeing if study time affects grades, first understand what grades students are getting
- Before checking if exercise helps weight loss, first see what peopleโs current weights are
What questions does univariate analysis answer?
- Whatโs typical? โ Whatโs the average? Whatโs most common?
- Whatโs the range? โ Whatโs the highest and lowest value?
- How spread out is it? โ Are values close together or far apart?
- Are there unusual values? โ Any outliers or weird data points?
For example: If youโre analyzing test scores in your class:
- Whatโs the average score? (Mean)
- What score appears most often? (Mode)
- Whatโs the middle score? (Median)
- Whatโs the highest and lowest score? (Range)
- Are most scores similar, or very different? (Spread)
One Variable] --> B{What Type?} B -->|Categorical| C[๐ Count Each
Category] B -->|Quantitative| D[๐ Look at
Numbers] C --> E[Make Bar Chart] D --> F[Make Histogram] E --> G[๐ฏ Find Most
Common Category] F --> H[๐ฏ Find Average,
Min, Max] style A fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style B fill:#E67E22,stroke:#A04000,stroke-width:3px,color:#fff style C fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff style D fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style E fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style F fill:#F39C12,stroke:#B9770E,stroke-width:3px,color:#fff style G fill:#1ABC9C,stroke:#117A65,stroke-width:3px,color:#fff style H fill:#16A085,stroke:#0E6655,stroke-width:3px,color:#fff
๐จ Example: Analyzing Favorite Fruits in Class
Step 1: Collect Data
- ๐ Apple: 10 students
- ๐ Banana: 7 students
- ๐ Orange: 5 students
- ๐ Grapes: 8 students
Step 2: Summary Metrics (Quick Facts)
- Mode (Most popular): Apple! ๐
- Total students: 30 students
- Variety: 4 different fruits
๐ Python Example: Categorical Data Analysis
import pandas as pd
import matplotlib.pyplot as plt
# Create data for favorite fruits
fruits_data = {
'Fruit': ['Apple', 'Banana', 'Orange', 'Grapes'],
'Count': [10, 7, 5, 8]
}
df_fruits = pd.DataFrame(fruits_data)
# Display the data
print(df_fruits)
print(f"\nMost popular fruit: {df_fruits.loc[df_fruits['Count'].idxmax(), 'Fruit']}")
print(f"Total students: {df_fruits['Count'].sum()}")
# Create a bar chart
plt.figure(figsize=(10, 6))
plt.bar(df_fruits['Fruit'], df_fruits['Count'], color=['red', 'yellow', 'orange', 'purple'])
plt.xlabel('Fruit Type', fontsize=12)
plt.ylabel('Number of Students', fontsize=12)
plt.title('Favorite Fruits in Class', fontsize=14, fontweight='bold')
plt.grid(axis='y', alpha=0.3)
# Add count labels on top of bars
for i, count in enumerate(df_fruits['Count']):
plt.text(i, count + 0.2, str(count), ha='center', fontweight='bold')
plt.show()
Output:
Fruit Count
0 Apple 10
1 Banana 7
2 Orange 5
3 Grapes 8
Most popular fruit: Apple
Total students: 30
๐ Summary Metrics for Numbers
Quick Facts About Numbers] --> B[Central Tendency
Where's the middle?] A --> C[Spread
How spread out?] A --> D[Extremes
Highest & Lowest] B --> E[Mean Average
Add all รท count] B --> F[Median Middle
The middle number] B --> G[Mode Most Common
Appears most often] C --> H[Range
Max - Min] C --> I[Standard Deviation
How far from average] D --> J[Maximum
Highest value] D --> K[Minimum
Lowest value] style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style B fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style C fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style D fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff
๐ฏ Easy Example: Test Scores
Scores: 70, 75, 80, 80, 85, 90, 95
- Mean (Average): (70+75+80+80+85+90+95) รท 7 = 82.1
- Median (Middle): 80 (the middle number when sorted)
- Mode (Most common): 80 (appears twice)
- Range: 95 - 70 = 25
- Min: 70, Max: 95
๐ Mathematical Formulas
Mean (Average):
Mean = (Sum of all values) / (Number of values)
ฮผ = (xโ + xโ + xโ + ... + xโ) / n
Median:
- Sort the data
- If odd number of values: middle value
- If even number of values: average of two middle values
Standard Deviation (How spread out the data is):
ฯ = โ[ฮฃ(xแตข - ฮผ)ยฒ / n]
Where:
- ฯ = standard deviation
- xแตข = each value
- ฮผ = mean
- n = number of values
Variance:
Variance = ฯยฒ
๐ Python Example: Analyzing Quantitative Data
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Test scores data
scores = [70, 75, 80, 80, 85, 90, 95]
# Calculate summary statistics
mean_score = np.mean(scores)
median_score = np.median(scores)
std_dev = np.std(scores)
variance = np.var(scores)
min_score = np.min(scores)
max_score = np.max(scores)
range_score = max_score - min_score
print("๐ Summary Statistics:")
print(f"Mean (Average): {mean_score:.2f}")
print(f"Median (Middle): {median_score}")
print(f"Standard Deviation: {std_dev:.2f}")
print(f"Variance: {variance:.2f}")
print(f"Minimum: {min_score}")
print(f"Maximum: {max_score}")
print(f"Range: {range_score}")
# Create histogram
plt.figure(figsize=(10, 6))
plt.hist(scores, bins=5, color='skyblue', edgecolor='black', alpha=0.7)
plt.axvline(mean_score, color='red', linestyle='--', linewidth=2, label=f'Mean: {mean_score:.1f}')
plt.axvline(median_score, color='green', linestyle='--', linewidth=2, label=f'Median: {median_score}')
plt.xlabel('Test Scores', fontsize=12)
plt.ylabel('Frequency', fontsize=12)
plt.title('Distribution of Test Scores', fontsize=14, fontweight='bold')
plt.legend()
plt.grid(axis='y', alpha=0.3)
plt.show()
๐ Real-World Example: Cricket Batsman Runs Analysis
Question: A batsman has scored the following runs in different matches. Plot a bar chart showing runs scored on the x-axis and frequency/count on the y-axis. In which bucket has he scored runs the most often?
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# Batsman's runs in different matches
runs = [23, 45, 67, 12, 89, 34, 56, 78, 45, 23, 67, 90, 12, 45, 56,
34, 78, 89, 23, 45, 67, 34, 56, 78, 45, 23, 12, 89, 67, 45]
# Create bins (buckets) for runs
bins = [0, 20, 40, 60, 80, 100]
labels = ['0-20', '21-40', '41-60', '61-80', '81-100']
# Categorize runs into bins
runs_binned = pd.cut(runs, bins=bins, labels=labels, include_lowest=True)
# Count frequency in each bin
frequency = runs_binned.value_counts().sort_index()
print("๐ Runs Distribution:")
print(frequency)
print(f"\n๐ฏ Most frequent bucket: {frequency.idxmax()} runs (appeared {frequency.max()} times)")
# Create bar chart
plt.figure(figsize=(12, 6))
bars = plt.bar(frequency.index, frequency.values, color='#2ECC71', edgecolor='black', linewidth=1.5)
plt.xlabel('Runs Scored (Buckets)', fontsize=13, fontweight='bold')
plt.ylabel('Frequency (Number of Times)', fontsize=13, fontweight='bold')
plt.title('Cricket Batsman: Runs Distribution Analysis', fontsize=15, fontweight='bold')
plt.grid(axis='y', alpha=0.3, linestyle='--')
# Add value labels on bars
for bar in bars:
height = bar.get_height()
plt.text(bar.get_x() + bar.get_width()/2., height,
f'{int(height)}',
ha='center', va='bottom', fontweight='bold', fontsize=11)
plt.tight_layout()
plt.show()
# Additional statistics
print(f"\n๐ Additional Statistics:")
print(f"Total matches: {len(runs)}")
print(f"Average runs: {np.mean(runs):.2f}")
print(f"Highest score: {np.max(runs)}")
print(f"Lowest score: {np.min(runs)}")
print(f"Median score: {np.median(runs):.2f}")
Expected Output:
๐ Runs Distribution:
0-20 3
21-40 8
41-60 9
61-80 7
81-100 3
๐ฏ Most frequent bucket: 41-60 runs (appeared 9 times)
๐ Additional Statistics:
Total matches: 30
Average runs: 50.27
Highest score: 90
Lowest score: 12
Median score: 50.50
Answer: The batsman scored runs in the 41-60 bucket most often (9 times out of 30 matches)!
๐ Chapter 3: Segmented Univariate Analysis (Comparing Groups)
Now weโre comparing the same thing across different groups!
Compare Groups] --> B[Step 1:
Take Your Data] B --> C[Step 2:
Divide into Groups] C --> D[Step 3:
Calculate Metrics
for Each Group] D --> E[Step 4:
Compare Groups] E --> F[๐ Find Differences!] style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style B fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style C fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff style D fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style E fill:#E67E22,stroke:#A04000,stroke-width:3px,color:#fff style F fill:#F39C12,stroke:#B9770E,stroke-width:3px,color:#fff
๐ฎ Example: Video Game Scores by Age Group
Discovery: Older players score higher on average! ๐ฏ
๐ Python Example: Segmented Analysis
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Create dataset for video game scores by age group
data = {
'Age_Group': ['8-10']*10 + ['11-13']*10 + ['14-16']*10,
'Score': [72, 78, 75, 70, 80, 73, 76, 74, 71, 81, # 8-10 years
88, 82, 87, 85, 90, 83, 86, 84, 81, 89, # 11-13 years
95, 90, 93, 92, 96, 91, 94, 89, 97, 88] # 14-16 years
}
df_games = pd.DataFrame(data)
# Calculate statistics for each group
group_stats = df_games.groupby('Age_Group')['Score'].agg(['mean', 'median', 'min', 'max', 'std'])
print("๐ Statistics by Age Group:")
print(group_stats)
# Create grouped bar chart
plt.figure(figsize=(12, 6))
age_groups = df_games['Age_Group'].unique()
means = [df_games[df_games['Age_Group']==ag]['Score'].mean() for ag in age_groups]
bars = plt.bar(age_groups, means, color=['#9B59B6', '#3498DB', '#2ECC71'],
edgecolor='black', linewidth=2)
plt.xlabel('Age Group', fontsize=13, fontweight='bold')
plt.ylabel('Average Score', fontsize=13, fontweight='bold')
plt.title('Video Game Scores by Age Group', fontsize=15, fontweight='bold')
plt.ylim(0, 100)
plt.grid(axis='y', alpha=0.3)
# Add value labels
for bar, mean in zip(bars, means):
plt.text(bar.get_x() + bar.get_width()/2., bar.get_height() + 1,
f'{mean:.1f}', ha='center', fontweight='bold', fontsize=12)
plt.tight_layout()
plt.show()
# Create box plot for detailed comparison
plt.figure(figsize=(12, 6))
sns.boxplot(data=df_games, x='Age_Group', y='Score', palette='Set2')
plt.xlabel('Age Group', fontsize=13, fontweight='bold')
plt.ylabel('Score', fontsize=13, fontweight='bold')
plt.title('Score Distribution by Age Group (Box Plot)', fontsize=15, fontweight='bold')
plt.grid(axis='y', alpha=0.3)
plt.tight_layout()
plt.show()
Output:
๐ Statistics by Age Group:
mean median min max std
Age_Group
8-10 75.0 74.5 70 81 3.771236
11-13 85.5 85.5 81 90 3.027650
14-16 92.5 92.5 88 97 3.027650
๐ค Chapter 4: Bivariate Analysis (Looking at Two Things Together)
Bivariate = โBiโ (two) + โvariateโ (variable) = Looking at TWO variables together
What is Bivariate Analysis?
After understanding each variable individually (univariate), we want to see if theyโre related to each other. Bivariate analysis looks at two variables at the same time to find relationships.
Think of it like this:
- Does studying more lead to better grades? (Study hours vs Test scores)
- Do taller people weigh more? (Height vs Weight)
- Do boys and girls prefer different games? (Gender vs Game preference)
What questions does bivariate analysis answer?
- Are they related? โ When one changes, does the other change too?
- How strong is the relationship? โ Is it a strong connection or weak?
- What direction? โ Do they move together (positive) or opposite (negative)?
- Can we predict one from the other? โ If I know X, can I guess Y?
Real-world examples:
- Weather & Ice Cream Sales: When temperature goes up, ice cream sales go up (positive relationship)
- Exercise & Weight: More exercise usually means less weight (negative relationship)
- Shoe Size & Math Score: No relationship at all (zero correlation)
Types of bivariate analysis:
- Number vs Number โ Use scatter plots and correlation
- Category vs Number โ Use box plots or bar charts by group
- Category vs Category โ Use cross-tabulation tables or stacked bars
Two Variables] --> B{What Types?} B -->|Both Numbers| C[๐ Correlation
Do they move together?] B -->|Both Categories| D[๐ Cross Tables
Compare groups] B -->|Mixed| E[๐ Group Comparison
Numbers by category] C --> F[Positive โ๏ธ
Both increase together] C --> G[Negative โ๏ธ
One up, one down] C --> H[Zero โ๏ธ
No relationship] style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style B fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff style C fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style D fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style E fill:#E67E22,stroke:#A04000,stroke-width:3px,color:#fff
๐ก๏ธ Understanding Correlation (Relationship Between Numbers)
What is Correlation?
Correlation tells us if two things are related to each other. When one thing changes, does the other thing change too? And if so, how?
Think of it like this:
- When you study more, do your grades go up? โ Thatโs a relationship!
- When you eat more ice cream, does it rain more? โ Probably no relationship!
Correlation measures this relationship with a number between -1 and +1:
- +1 = Perfect positive relationship (they move together)
- 0 = No relationship at all
- -1 = Perfect negative relationship (they move opposite)
Important: Correlation does NOT mean one thing causes the other! It just means they move together.
Example: Ice cream sales and drowning incidents both increase in summer. Theyโre correlated, but ice cream doesnโt cause drowning! The real cause is hot weather (people swim more AND eat more ice cream).
How two things relate] --> B[Positive Correlation โ๏ธ
+1 to 0] A --> C[Negative Correlation โ๏ธ
-1 to 0] A --> D[No Correlation โ๏ธ
Around 0] B --> E[Example:
โฐ Study Time โ
๐ Test Score โ] C --> F[Example:
๐ฎ Gaming Time โ
๐ด Sleep Time โ] D --> G[Example:
๐ Shoe Size
๐งฎ Math Score] style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style B fill:#27AE60,stroke:#186A3B,stroke-width:3px,color:#fff style C fill:#E67E22,stroke:#A04000,stroke-width:3px,color:#fff style D fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style E fill:#1ABC9C,stroke:#117A65,stroke-width:3px,color:#fff style F fill:#F39C12,stroke:#B9770E,stroke-width:3px,color:#fff style G fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff
๐ฏ Real-World Examples
Positive Correlation (Both go up together):
- ๐ More study hours โ ๐ Better grades
- ๐ More practice โ โฝ Better at sports
- ๐ง๏ธ More rain โ โ More umbrellas sold
Negative Correlation (One up, one down):
- ๐ฎ More video games โ ๐ Less homework time
- ๐ญ More candy โ ๐ฆท More cavities
- ๐ More exercise โ โ๏ธ Less weight
No Correlation (Not related):
- ๐ Shoe size โ ๐งฎ Math test score
- ๐จ Favorite color โ ๐ Height
- ๐ Number of pets โ ๐ Birthday month
๐ Correlation Formula
Pearson Correlation Coefficient (r):
r = ฮฃ[(xแตข - xฬ)(yแตข - ศณ)] / โ[ฮฃ(xแตข - xฬ)ยฒ ร ฮฃ(yแตข - ศณ)ยฒ]
Where:
- r = correlation coefficient (-1 to +1)
- xแตข, yแตข = individual data points
- xฬ, ศณ = means of x and y
- ฮฃ = sum of all values
Interpretation:
- r = +1: Perfect positive correlation
- r = +0.7 to +1: Strong positive correlation
- r = +0.3 to +0.7: Moderate positive correlation
- r = 0: No correlation
- r = -0.3 to -0.7: Moderate negative correlation
- r = -0.7 to -1: Strong negative correlation
- r = -1: Perfect negative correlation
๐ Python Example: Correlation Analysis
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Example 1: Positive Correlation - Study Hours vs Test Scores
study_hours = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
test_scores = [45, 52, 58, 65, 70, 75, 82, 88, 92, 95]
# Calculate correlation
correlation = np.corrcoef(study_hours, test_scores)[0, 1]
print(f"๐ Correlation between Study Hours and Test Scores: {correlation:.3f}")
# Create scatter plot
fig, axes = plt.subplots(1, 3, figsize=(18, 5))
# Plot 1: Positive Correlation
axes[0].scatter(study_hours, test_scores, color='#2ECC71', s=100, edgecolor='black', linewidth=1.5)
axes[0].plot(np.unique(study_hours),
np.poly1d(np.polyfit(study_hours, test_scores, 1))(np.unique(study_hours)),
color='red', linewidth=2, linestyle='--', label='Trend Line')
axes[0].set_xlabel('Study Hours', fontsize=12, fontweight='bold')
axes[0].set_ylabel('Test Scores', fontsize=12, fontweight='bold')
axes[0].set_title(f'Positive Correlation\nr = {correlation:.3f}', fontsize=13, fontweight='bold')
axes[0].grid(alpha=0.3)
axes[0].legend()
# Example 2: Negative Correlation - Gaming Hours vs Sleep Hours
gaming_hours = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
sleep_hours = [9, 8.5, 8, 7.5, 7, 6.5, 6, 5.5, 5, 4.5]
correlation_neg = np.corrcoef(gaming_hours, sleep_hours)[0, 1]
axes[1].scatter(gaming_hours, sleep_hours, color='#E67E22', s=100, edgecolor='black', linewidth=1.5)
axes[1].plot(np.unique(gaming_hours),
np.poly1d(np.polyfit(gaming_hours, sleep_hours, 1))(np.unique(gaming_hours)),
color='red', linewidth=2, linestyle='--', label='Trend Line')
axes[1].set_xlabel('Gaming Hours', fontsize=12, fontweight='bold')
axes[1].set_ylabel('Sleep Hours', fontsize=12, fontweight='bold')
axes[1].set_title(f'Negative Correlation\nr = {correlation_neg:.3f}', fontsize=13, fontweight='bold')
axes[1].grid(alpha=0.3)
axes[1].legend()
# Example 3: No Correlation - Shoe Size vs Math Score
shoe_size = [6, 7, 8, 9, 10, 6.5, 7.5, 8.5, 9.5, 10.5]
math_score = [75, 82, 68, 90, 73, 88, 65, 78, 85, 70]
correlation_zero = np.corrcoef(shoe_size, math_score)[0, 1]
axes[2].scatter(shoe_size, math_score, color='#3498DB', s=100, edgecolor='black', linewidth=1.5)
axes[2].set_xlabel('Shoe Size', fontsize=12, fontweight='bold')
axes[2].set_ylabel('Math Score', fontsize=12, fontweight='bold')
axes[2].set_title(f'No Correlation\nr = {correlation_zero:.3f}', fontsize=13, fontweight='bold')
axes[2].grid(alpha=0.3)
plt.tight_layout()
plt.show()
# Create correlation heatmap for multiple variables
data_multi = {
'Study_Hours': [2, 4, 6, 8, 3, 5, 7, 9, 1, 10],
'Test_Score': [55, 68, 78, 88, 62, 72, 82, 92, 48, 95],
'Sleep_Hours': [7, 7.5, 8, 8.5, 7, 7.5, 8, 8.5, 6.5, 9],
'Gaming_Hours': [5, 3, 2, 1, 4, 3, 2, 1, 6, 0.5]
}
df_multi = pd.DataFrame(data_multi)
# Calculate correlation matrix
corr_matrix = df_multi.corr()
print("\n๐ Correlation Matrix:")
print(corr_matrix)
# Plot heatmap
plt.figure(figsize=(10, 8))
sns.heatmap(corr_matrix, annot=True, cmap='coolwarm', center=0,
square=True, linewidths=2, cbar_kws={"shrink": 0.8},
fmt='.3f', vmin=-1, vmax=1)
plt.title('Correlation Heatmap', fontsize=15, fontweight='bold', pad=20)
plt.tight_layout()
plt.show()
Output:
๐ Correlation between Study Hours and Test Scores: 0.989
๐ Correlation Matrix:
Study_Hours Test_Score Sleep_Hours Gaming_Hours
Study_Hours 1.000000 0.989123 0.876543 -0.945678
Test_Score 0.989123 1.000000 0.865432 -0.932109
Sleep_Hours 0.876543 0.865432 1.000000 -0.812345
Gaming_Hours -0.945678 -0.932109 -0.812345 1.000000
Insights:
- โ Study Hours and Test Scores have strong positive correlation (0.989)
- โ Gaming Hours and Test Scores have strong negative correlation (-0.932)
- โ Sleep Hours and Test Scores have strong positive correlation (0.865)
๐จ Chapter 5: Categorical Bivariate Analysis
Comparing two categories together!
๐ฎ Example: Gaming Habits by Gender
Discoveries:
- More boys play every day than girls
- More girls play once a week
- More girls never play than boys
๐ Python Example: Categorical Bivariate Analysis
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Create gaming habits data
data = {
'Gender': ['Boys']*28 + ['Girls']*32,
'Frequency': ['Every Day']*15 + ['Once a Week']*8 + ['Once a Month']*3 + ['Never']*2 +
['Every Day']*8 + ['Once a Week']*12 + ['Once a Month']*5 + ['Never']*7
}
df_gaming = pd.DataFrame(data)
# Create cross-tabulation (contingency table)
cross_tab = pd.crosstab(df_gaming['Gender'], df_gaming['Frequency'])
print("๐ Cross-Tabulation Table:")
print(cross_tab)
print()
# Calculate percentages
cross_tab_pct = pd.crosstab(df_gaming['Gender'], df_gaming['Frequency'], normalize='index') * 100
print("๐ Percentage Distribution:")
print(cross_tab_pct.round(2))
# Create grouped bar chart
cross_tab.plot(kind='bar', figsize=(12, 6), color=['#E74C3C', '#3498DB', '#2ECC71', '#F39C12'],
edgecolor='black', linewidth=1.5)
plt.xlabel('Gender', fontsize=13, fontweight='bold')
plt.ylabel('Count', fontsize=13, fontweight='bold')
plt.title('Gaming Frequency by Gender', fontsize=15, fontweight='bold')
plt.legend(title='Frequency', title_fontsize=12, fontsize=11)
plt.xticks(rotation=0)
plt.grid(axis='y', alpha=0.3)
plt.tight_layout()
plt.show()
# Create stacked bar chart
cross_tab_pct.plot(kind='bar', stacked=True, figsize=(12, 6),
color=['#E74C3C', '#3498DB', '#2ECC71', '#F39C12'],
edgecolor='black', linewidth=1.5)
plt.xlabel('Gender', fontsize=13, fontweight='bold')
plt.ylabel('Percentage (%)', fontsize=13, fontweight='bold')
plt.title('Gaming Frequency Distribution by Gender (%)', fontsize=15, fontweight='bold')
plt.legend(title='Frequency', title_fontsize=12, fontsize=11, bbox_to_anchor=(1.05, 1))
plt.xticks(rotation=0)
plt.tight_layout()
plt.show()
# Create heatmap
plt.figure(figsize=(10, 6))
sns.heatmap(cross_tab, annot=True, fmt='d', cmap='YlOrRd', cbar_kws={'label': 'Count'},
linewidths=2, linecolor='black')
plt.xlabel('Gaming Frequency', fontsize=13, fontweight='bold')
plt.ylabel('Gender', fontsize=13, fontweight='bold')
plt.title('Gaming Habits Heatmap', fontsize=15, fontweight='bold')
plt.tight_layout()
plt.show()
Output:
๐ Cross-Tabulation Table:
Frequency Every Day Never Once a Month Once a Week
Gender
Boys 15 2 3 8
Girls 8 7 5 12
๐ Percentage Distribution:
Frequency Every Day Never Once a Month Once a Week
Gender
Boys 53.57 7.14 10.71 28.57
Girls 25.00 21.88 15.62 37.50
๐ Chapter 6: Derived Metrics (Creating New Information)
Sometimes we can combine information to discover new things!
Create New Variables] --> B[Type-Driven
Change the type] A --> C[Business-Driven
Domain knowledge] A --> D[Data-Driven
Combine existing data] B --> E[Example:
Age in years โ
Age groups] C --> F[Example:
Sales data โ
Profit margin] D --> G[Example:
Height + Weight โ
BMI] style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style B fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style C fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style D fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff style E fill:#1ABC9C,stroke:#117A65,stroke-width:3px,color:#fff style F fill:#F39C12,stroke:#B9770E,stroke-width:3px,color:#fff style G fill:#27AE60,stroke:#186A3B,stroke-width:3px,color:#fff
๐ฏ Stevenโs Typology (Fancy Way to Classify Variables)
4 Types of Variables] --> B[1. Nominal
Just Names] A --> C[2. Ordinal
Has Order] A --> D[3. Interval
Can Subtract] A --> E[4. Ratio
Can Divide/Multiply] B --> F[๐จ Colors
๐พ Pet types
Can't compare] C --> G[๐ Ranks: 1st, 2nd, 3rd
๐ Grades: A, B, C
Can order] D --> H[๐ก๏ธ Temperature ยฐC
๐ Dates
Can find difference] E --> I[๐ฐ Money
๐ Height
โ๏ธ Weight
Can do all math] style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style B fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff style C fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style D fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style E fill:#E67E22,stroke:#A04000,stroke-width:3px,color:#fff
๐ Fun Examples of Derived Metrics
Type-Driven: Changing how we look at data
- Age (10, 11, 12, 13โฆ) โ Age Groups (Children, Teens, Adults)
- Exact time (2:34 PM) โ Time of day (Morning, Afternoon, Evening)
Business-Driven: Using real-world knowledge
- Lemonade sold + Cost โ Profit
- Goals scored - Goals allowed โ Goal difference
Data-Driven: Combining existing data
- Height + Weight โ BMI (Body Mass Index)
- Total score รท Number of tests โ Average score
- Distance รท Time โ Speed
๐ BMI Formula
Body Mass Index (BMI):
BMI = Weight (kg) / [Height (m)]ยฒ
Categories:
- Underweight: BMI < 18.5
- Normal weight: 18.5 โค BMI < 25
- Overweight: 25 โค BMI < 30
- Obese: BMI โฅ 30
๐ Python Example: Creating Derived Metrics
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Create sample data
data = {
'Name': ['Alice', 'Bob', 'Charlie', 'Diana', 'Eve', 'Frank', 'Grace', 'Henry'],
'Age': [10, 12, 15, 13, 11, 14, 16, 9],
'Height_cm': [140, 155, 170, 160, 145, 165, 175, 135],
'Weight_kg': [35, 45, 60, 50, 38, 55, 65, 30],
'Test1': [85, 78, 92, 88, 75, 90, 95, 70],
'Test2': [88, 82, 90, 85, 78, 88, 92, 75],
'Test3': [90, 80, 95, 90, 80, 92, 98, 72]
}
df = pd.DataFrame(data)
# 1. Type-Driven: Create Age Groups
df['Age_Group'] = pd.cut(df['Age'], bins=[0, 10, 13, 18],
labels=['Children (โค10)', 'Tweens (11-13)', 'Teens (14+)'])
# 2. Data-Driven: Calculate BMI
df['Height_m'] = df['Height_cm'] / 100 # Convert cm to meters
df['BMI'] = df['Weight_kg'] / (df['Height_m'] ** 2)
df['BMI_Category'] = pd.cut(df['BMI'],
bins=[0, 18.5, 25, 30, 100],
labels=['Underweight', 'Normal', 'Overweight', 'Obese'])
# 3. Data-Driven: Calculate Average Test Score
df['Average_Score'] = (df['Test1'] + df['Test2'] + df['Test3']) / 3
# 4. Business-Driven: Performance Category
df['Performance'] = pd.cut(df['Average_Score'],
bins=[0, 70, 80, 90, 100],
labels=['Needs Improvement', 'Good', 'Very Good', 'Excellent'])
print("๐ Original Data with Derived Metrics:")
print(df[['Name', 'Age', 'Age_Group', 'BMI', 'BMI_Category', 'Average_Score', 'Performance']])
# Visualize BMI distribution
plt.figure(figsize=(14, 6))
# Plot 1: BMI by Person
plt.subplot(1, 2, 1)
colors = ['#E74C3C' if x < 18.5 else '#2ECC71' if x < 25 else '#E67E22'
for x in df['BMI']]
bars = plt.bar(df['Name'], df['BMI'], color=colors, edgecolor='black', linewidth=1.5)
plt.axhline(y=18.5, color='red', linestyle='--', label='Underweight threshold')
plt.axhline(y=25, color='orange', linestyle='--', label='Overweight threshold')
plt.xlabel('Name', fontsize=12, fontweight='bold')
plt.ylabel('BMI', fontsize=12, fontweight='bold')
plt.title('BMI by Person', fontsize=14, fontweight='bold')
plt.xticks(rotation=45)
plt.legend()
plt.grid(axis='y', alpha=0.3)
# Plot 2: Average Score by Age Group
plt.subplot(1, 2, 2)
age_group_avg = df.groupby('Age_Group')['Average_Score'].mean()
bars = plt.bar(age_group_avg.index, age_group_avg.values,
color=['#9B59B6', '#3498DB', '#2ECC71'],
edgecolor='black', linewidth=1.5)
plt.xlabel('Age Group', fontsize=12, fontweight='bold')
plt.ylabel('Average Test Score', fontsize=12, fontweight='bold')
plt.title('Performance by Age Group', fontsize=14, fontweight='bold')
plt.ylim(0, 100)
plt.grid(axis='y', alpha=0.3)
# Add value labels
for bar in bars:
height = bar.get_height()
plt.text(bar.get_x() + bar.get_width()/2., height + 1,
f'{height:.1f}', ha='center', fontweight='bold')
plt.tight_layout()
plt.show()
# Summary statistics
print("\n๐ Summary by Age Group:")
print(df.groupby('Age_Group')[['BMI', 'Average_Score']].mean().round(2))
print("\n๐ Performance Distribution:")
print(df['Performance'].value_counts())
Output:
๐ Original Data with Derived Metrics:
Name Age Age_Group BMI BMI_Category Average_Score Performance
0 Alice 10 Children (โค10) 17.86 Underweight 87.67 Very Good
1 Bob 12 Tweens (11-13) 18.73 Normal 80.00 Good
2 Charlie 15 Teens (14+) 20.76 Normal 92.33 Excellent
3 Diana 13 Tweens (11-13) 19.53 Normal 87.67 Very Good
4 Eve 11 Tweens (11-13) 18.08 Underweight 77.67 Good
5 Frank 14 Teens (14+) 20.20 Normal 90.00 Excellent
6 Grace 16 Teens (14+) 21.22 Normal 95.00 Excellent
7 Henry 9 Children (โค10) 16.46 Underweight 72.33 Good
๐ Summary by Age Group:
BMI Average_Score
Age_Group
Children (โค10) 17.16 80.00
Tweens (11-13) 18.78 81.78
Teens (14+) 20.73 92.44
๐ Performance Distribution:
Performance
Excellent 3
Very Good 2
Good 3
Needs Improvement 0
๐ฏ The Complete EDA Process
What data do I have?] B --> C[๐งน Step 2: Clean
Fix errors & missing data] C --> D[๐ Step 3: Univariate
Look at each variable] D --> E[๐ Step 4: Segmented
Compare groups] E --> F[๐ค Step 5: Bivariate
Find relationships] F --> G[๐จ Step 6: Derived Metrics
Create new variables] G --> H[๐ก Step 7: Insights
What did we learn?] H --> I[๐ Done: Make Decisions!] style A fill:#3498DB,stroke:#1F618D,stroke-width:3px,color:#fff style B fill:#9B59B6,stroke:#6C3483,stroke-width:3px,color:#fff style C fill:#2ECC71,stroke:#1E8449,stroke-width:3px,color:#fff style D fill:#E67E22,stroke:#A04000,stroke-width:3px,color:#fff style E fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style F fill:#F39C12,stroke:#B9770E,stroke-width:3px,color:#fff style G fill:#1ABC9C,stroke:#117A65,stroke-width:3px,color:#fff style H fill:#27AE60,stroke:#186A3B,stroke-width:3px,color:#fff style I fill:#C0392B,stroke:#7B241C,stroke-width:3px,color:#fff
๐ Quick Reference Guide
๐ EDA Checklist
๐ฏ When to Use What
| What You Want to Know | What to Use | Example |
|---|---|---|
| Most common category | Mode | Most popular ice cream flavor |
| Average number | Mean | Average test score |
| Middle value | Median | Middle height in class |
| Spread of data | Range, Std Dev | How different are the scores? |
| Compare groups | Segmented Analysis | Boys vs Girls scores |
| Relationship | Correlation | Study time vs grades |
๐ Key Takeaways
Being a Detective)) ๐ Observe Look at all clues Find patterns ๐ Measure Count things Calculate averages ๐ค Compare Find differences Spot relationships ๐ก Discover Hidden patterns New insights ๐ฏ Conclude Make decisions Solve problems
๐ Remember
- EDA is exploring - Like exploring a new playground!
- Look at one thing first - Before looking at many things together
- Compare groups - Find what makes them different
- Find relationships - See how things connect
- Create new insights - Combine information in clever ways
- 80% of data work is EDA - Itโs the most important part!
๐ฎ Practice Exercises with Python
๐ Exercise 1: Cricket Player Analysis
Problem: Analyze a cricket playerโs performance across different matches.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# Player's runs in 25 matches
runs = [45, 23, 67, 89, 12, 56, 78, 34, 90, 45, 67, 23, 89, 56, 78,
34, 45, 67, 89, 23, 56, 78, 45, 67, 90]
# Tasks:
# 1. Calculate mean, median, mode
# 2. Find the range
# 3. Create bins: 0-20, 21-40, 41-60, 61-80, 81-100
# 4. Plot a histogram showing frequency in each bin
# 5. Answer: In which bucket did the player score most often?
# Your code here:
๐ก Click to see solution
```python # Solution mean_runs = np.mean(runs) median_runs = np.median(runs) from scipy import stats mode_runs = stats.mode(runs, keepdims=True)[0][0] range_runs = np.max(runs) - np.min(runs) print(f"Mean: {mean_runs:.2f}") print(f"Median: {median_runs}") print(f"Mode: {mode_runs}") print(f"Range: {range_runs}") # Create bins bins = [0, 20, 40, 60, 80, 100] labels = ['0-20', '21-40', '41-60', '61-80', '81-100'] runs_binned = pd.cut(runs, bins=bins, labels=labels) frequency = runs_binned.value_counts().sort_index() print(f"\nMost frequent bucket: {frequency.idxmax()} (appeared {frequency.max()} times)") # Plot plt.figure(figsize=(10, 6)) bars = plt.bar(frequency.index, frequency.values, color='#2ECC71', edgecolor='black') plt.xlabel('Runs Bucket') plt.ylabel('Frequency') plt.title('Cricket Player: Runs Distribution') for bar in bars: height = bar.get_height() plt.text(bar.get_x() + bar.get_width()/2., height, f'{int(height)}', ha='center', va='bottom', fontweight='bold') plt.show() ```๐ Exercise 2: Student Performance by Subject
Problem: Compare student performance across different subjects.
# Student scores in different subjects
data = {
'Student': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'],
'Math': [85, 78, 92, 88, 75, 90, 95, 70, 82, 88],
'Science': [88, 82, 90, 85, 78, 88, 92, 75, 85, 90],
'English': [90, 80, 95, 90, 80, 92, 98, 72, 88, 92]
}
# Tasks:
# 1. Calculate average score for each subject
# 2. Find which subject has highest average
# 3. Create a grouped bar chart
# 4. Calculate correlation between Math and Science
# 5. Create a scatter plot showing Math vs Science scores
๐ก Click to see solution
```python df = pd.DataFrame(data) # Average scores avg_scores = df[['Math', 'Science', 'English']].mean() print("Average Scores:") print(avg_scores) print(f"\nHighest average: {avg_scores.idxmax()} ({avg_scores.max():.2f})") # Grouped bar chart df.set_index('Student')[['Math', 'Science', 'English']].plot(kind='bar', figsize=(12, 6)) plt.ylabel('Score') plt.title('Student Performance by Subject') plt.legend(title='Subject') plt.xticks(rotation=45) plt.grid(axis='y', alpha=0.3) plt.tight_layout() plt.show() # Correlation correlation = np.corrcoef(df['Math'], df['Science'])[0, 1] print(f"\nCorrelation between Math and Science: {correlation:.3f}") # Scatter plot plt.figure(figsize=(8, 6)) plt.scatter(df['Math'], df['Science'], s=100, color='#3498DB', edgecolor='black') plt.xlabel('Math Score') plt.ylabel('Science Score') plt.title(f'Math vs Science Scores (r = {correlation:.3f})') plt.grid(alpha=0.3) plt.show() ```๐ Exercise 3: Sales Analysis by Region
Problem: Analyze sales data across different regions and product categories.
# Sales data
sales_data = {
'Region': ['North']*6 + ['South']*6 + ['East']*6 + ['West']*6,
'Product': ['A', 'B', 'C']*8,
'Sales': [120, 150, 180, 130, 160, 190, 140, 170, 200, 125, 155, 185,
135, 165, 195, 145, 175, 205, 128, 158, 188, 138, 168, 198]
}
# Tasks:
# 1. Create a cross-tabulation of Region vs Product
# 2. Find which region has highest total sales
# 3. Find which product sells best overall
# 4. Create a heatmap showing sales by region and product
# 5. Calculate average sales by region
๐ก Click to see solution
```python import seaborn as sns df_sales = pd.DataFrame(sales_data) # Cross-tabulation cross_tab = pd.crosstab(df_sales['Region'], df_sales['Product'], values=df_sales['Sales'], aggfunc='sum') print("Sales by Region and Product:") print(cross_tab) # Total sales by region region_total = df_sales.groupby('Region')['Sales'].sum() print(f"\nHighest sales region: {region_total.idxmax()} (${region_total.max()})") # Best selling product product_total = df_sales.groupby('Product')['Sales'].sum() print(f"Best selling product: {product_total.idxmax()} (${product_total.max()})") # Heatmap plt.figure(figsize=(10, 6)) sns.heatmap(cross_tab, annot=True, fmt='d', cmap='YlGnBu', cbar_kws={'label': 'Sales ($)'}) plt.title('Sales Heatmap: Region vs Product') plt.tight_layout() plt.show() # Average by region avg_by_region = df_sales.groupby('Region')['Sales'].mean() print("\nAverage Sales by Region:") print(avg_by_region) ```๐ Exercise 4: Create Your Own Analysis!
Challenge: Collect your own data and perform complete EDA!
Ideas:
- ๐ฑ Screen time tracking for a week
- ๐ Daily steps count
- ๐ก๏ธ Temperature readings
- ๐ฎ Game scores over time
- ๐ Time spent on different activities
Steps to follow:
- Collect at least 20 data points
- Perform univariate analysis (mean, median, mode, range)
- Create appropriate visualizations
- If you have two variables, check for correlation
- Create at least one derived metric
- Write a summary of your findings
Template Code:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# Your data here
my_data = {
'Variable1': [], # Add your data
'Variable2': [] # Add your data if applicable
}
df = pd.DataFrame(my_data)
# Step 1: Basic statistics
print("Summary Statistics:")
print(df.describe())
# Step 2: Visualizations
# Add your plots here
# Step 3: Analysis
# Add your analysis here
# Step 4: Insights
print("\n๐ My Findings:")
# Write what you discovered!
๐ฏ Quick Practice Questions
Answer these using Python:
-
Q: Given scores
[65, 70, 75, 80, 85, 90, 95], what is the mean and standard deviation? -
Q: Create a bar chart showing frequency of grades: A(5), B(8), C(6), D(3), F(1)
-
Q: Calculate correlation between study hours
[2, 4, 6, 8, 10]and scores[60, 70, 80, 90, 95] -
Q: Create age groups from ages
[8, 12, 15, 9, 13, 16, 10, 14, 11, 17]: Children(โค10), Tweens(11-13), Teens(14+) -
Q: Calculate BMI for: Height=165cm, Weight=60kg. Categorize the result.
๐จ Visual Summary
๐ Types of Variables] A --> C[Chapter 2:
๐ Univariate Analysis] A --> D[Chapter 3:
๐ Segmented Analysis] A --> E[Chapter 4:
๐ค Bivariate Analysis] A --> F[Chapter 5:
๐จ Derived Metrics] B --> G[Categorical vs
Quantitative] C --> H[One variable
at a time] D --> I[Compare
groups] E --> J[Find
relationships] F --> K[Create new
insights] G --> L[๐ Become a
Data Detective!] H --> L I --> L J --> L K --> L style A fill:#E74C3C,stroke:#A93226,stroke-width:3px,color:#fff style L fill:#C0392B,stroke:#7B241C,stroke-width:3px,color:#fff
๐ Conclusion
Exploratory Data Analysis is like being a detective with numbers! You:
- ๐ Look carefully at your data
- ๐ Make charts and graphs
- ๐งฎ Calculate important numbers
- ๐ค Compare different groups
- ๐ก Discover hidden patterns
- ๐ฏ Make smart decisions
The more you explore, the more you discover! Just like exploring a new video game or a new park, data exploration is an adventure where you find cool things the more you look!
Remember: Every great data scientist started by being curious and asking questions. Keep exploring! ๐
Made with โค๏ธ for young learners and curious minds!
๐ Glossary (Word Bank)
- Variable: A piece of information (like age, color, or score)
- Categorical: Information in categories/groups (like colors or types)
- Quantitative: Number information you can measure
- Mean: Average (add all numbers and divide by count)
- Median: The middle number when sorted
- Mode: The most common value
- Correlation: How two things relate to each other
- Distribution: How data is spread out
- Metric: A way to measure something
๐ป Hands-On Practice
Ready to practice with real data?
Check out the Jupyter Notebook with EDA Examples using the Iris dataset!
Whatโs included:
- โ Complete working code
- โ Real dataset (Iris flowers)
- โ Step-by-step visualizations
- โ Summary statistics examples
- โ Pattern discovery exercises
To run the notebook:
- Install:
pip install pandas numpy matplotlib seaborn scikit-learn jupyter - Download the notebook from the repository
- Run:
jupyter notebook chapter1_eda_examples.ipynb
๐ See the notebooks README for full instructions!