π Descriptive Statistics Explained Simply | Mean, Median & Std Dev
Part 3: Statistics for Data Science Series
Goal: Learn how to summarize data effectively before analysis
When working with data, the first and most important question is:
π βWhat does this data look like?β
This is where Descriptive Statistics comes in.
Descriptive statistics help us summarize, understand, and interpret data using simple numerical measures. Before any machine learning, prediction, or dashboarding β descriptive stats are your foundation.
π What is Descriptive Statistics?
Descriptive statistics are techniques used to summarize and describe the main features of a dataset.
They help answer questions like:
- What is the average value?
- How spread out is the data?
- Are there extreme values?
- Where does most of the data lie?
π Unlike inferential statistics, descriptive statistics do not make predictions β they explain what already exists.
π Measures of Central Tendency (Finding the βCenterβ)
1οΈβ£ Mean (Average)
Definition:
The sum of all values divided by the total number of values.
Formula:
Mean = (Sum of values) / (Number of values)
π Real-Life Example:
Average daily sales of an e-commerce store over 5 days:
βΉ10k, βΉ12k, βΉ11k, βΉ13k, βΉ14k
Mean = βΉ12k
π’ Best used when data has no extreme outliers
2οΈβ£ Median (Middle Value)
Definition:
The middle value when data is sorted.
π Example:
Monthly salaries in a startup:
βΉ25k, βΉ30k, βΉ35k, βΉ40k, βΉ5,00,000
Median = βΉ35k
π’ Best used when data contains outliers
3οΈβ£ Mode (Most Frequent Value)
Definition:
The value that appears most often.
π Example:
Most sold product sizes:
M, M, L, S, M, L
Mode = M
π’ Useful for categorical data
π Measures of Dispersion (Understanding Spread)
4οΈβ£ Range
Definition:
Difference between the maximum and minimum values.
π Example:
City temperature range:
Min = 20Β°C, Max = 45Β°C
Range = 25Β°C
β οΈ Highly sensitive to outliers
5οΈβ£ Variance
Definition:
Average of squared differences from the mean.
- Low variance β values are close together
- High variance β values are spread out
π’ Widely used in finance and risk analysis
6οΈβ£ Standard Deviation
Definition:
Square root of variance.
π Example:
Stocks with high standard deviation are more volatile.
π’ Most important dispersion metric
π’ Same unit as original data
π Percentiles & Interquartile Range (IQR)
7οΈβ£ Percentiles
Definition:
A percentile shows the value below which a certain percentage of data falls.
π Example:
90th percentile salary = βΉ20 LPA
You earn more than 90% of employees.
8οΈβ£ Interquartile Range (IQR)
Formula:
IQR = Q3 β Q1
Why it matters:
- Identifies outliers
- Used in box plots
- Robust against extreme values
π Real Scenario:
Detecting abnormal insurance claims or fraud transactions.
π§ Summary Statistics in Python (Hands-On)
Pandas is the most widely used Python library for descriptive statistics.
πΉ Sample Dataset
import pandas as pd
data = {
"Sales": [12000, 15000, 10000, 18000, 16000],
"Profit": [2000, 3000, 1500, 4000, 3500]
}
df = pd.DataFrame(data)
πΉ Using Pandas .describe()
df.describe()
.describe() instantly provides:
- Count
- Mean
- Standard Deviation
- Minimum & Maximum
- 25%, 50% (Median), 75% percentiles
π’ Used in almost every real-world data analysis project
πΉ Individual Statistics in Pandas
df.mean() df.median() df.std() df.var() df.quantile(0.75)
π’ Real-World Applications
π Business
- Average revenue per customer
- Monthly sales analysis
- Customer behavior tracking
π Finance
- Stock volatility measurement
- Risk evaluation
- Portfolio performance
π Healthcare
- Patient recovery analysis
- Hospital stay durations
- Disease statistics
π Key Takeaways
- Descriptive statistics summarize data
- Mean, median, mode explain central tendency
- Standard deviation explains variability
- Percentiles & IQR handle outliers
- Pandas
.describe()is essential for EDA
π Whatβs Next?
Part 4: Data Visualization for Statistics
- Histograms
- Box plots
- Bar charts
- Python visualizations
Statistics isnβt hard β itβs just misunderstood. Keep learning! π
β Frequently Asked Questions (FAQ)
What is descriptive statistics?
Descriptive statistics is a branch of statistics that summarizes and describes the main characteristics of a dataset using measures like mean, median, mode, variance, and standard deviation.
Why is descriptive statistics important in data science?
Descriptive statistics helps data scientists understand data distribution, identify patterns, detect outliers, and prepare datasets for further analysis and machine learning models.
What is the difference between mean and median?
The mean is the average of all values, while the median is the middle value when data is sorted. Median is more reliable when the dataset contains outliers.
When should I use standard deviation?
Standard deviation is used to measure how spread out values are from the mean. It is commonly used in finance, business analytics, and risk assessment.
What is Pandas describe() used for?
The describe() function in Pandas provides a quick summary of key descriptive statistics including count, mean, standard deviation, minimum, maximum, and percentiles.
Is descriptive statistics enough for data analysis?
Descriptive statistics is the first step in data analysis. For predictions and conclusions about future data, inferential statistics and machine learning techniques are required.
Labels: Descriptive Statistics in SAS, Statistics, statistics examples, Statistics for Data Science

