Free course · Lesson 2 of 5
Exploratory Data Analysis (EDA)
In this lesson you will
- Explore a data set with summaries and groups
- Find missing, impossible and unusual values
EDA is the process of getting to know your dataset before building any models. You use descriptive statistics and summary functions to uncover patterns, anomalies, and distributions. EDA answers questions like: "Are there outliers?" "Which columns are most correlated?" "Is the data balanced across groups?"
df.describe()— summary statistics (count, mean, min, max, quartiles) for numeric columns.df.info()— column names, data types, and non-null counts. Essential for spotting missing data.df['column'].value_counts()— frequency distribution of categorical values.- Always visualize distributions early — a histogram or boxplot reveals outliers and skew that summary stats alone can hide.
Practical Skill: In Jupyter Notebooks, run EDA commands cell by cell. Use Pandas for tabular summaries and Matplotlib or Seaborn for quick plots. The goal is to form hypotheses, not confirm them.
Python (Pandas)
# Exploratory Data Analysis with Pandas # Install: pip install pandas import pandas as pd import numpy as np # Create a mock public health dataset data = { "clinic": ["A", "B", "C", "D", "E", "F"], "patients": [340, 510, 480, 180, 620, 280], "staff": [5, 8, 6, 2, 10, 4], "region": ["Central", "Central", "Equatoria", "Equatoria", "Central", "Upper Nile"], "vaccination_rate": [0.72, 0.88, 0.65, 0.91, 0.95, 0.54] } df = pd.DataFrame(data) # 1. Structure overview print("=== Dataset Info ===") print(df.info()) print("\n=== Summary Statistics ===") print(df.describe()) print("\n=== Per-Region Distribution ===") print(df["region"].value_counts()) print("\n=== Average Patients by Region ===") print(df.groupby("region")["patients"].mean().round(0)) # Key finding print("\nInsight: Central region has more staff and higher patient volume.") print("Upper Nile has the lowest vaccination rate — may need investigation.")
Practice exercise
Using a small survey table, find the district with the longest median walk to water and list any values that look impossible.
Key takeaways
- Explore before you analyse
- Compare groups with percentages and their sizes
- Check unusual values before removing them
Free self-study lesson — no certificate. For the full instructor-led program, see registration options.