394 ZB
estimated global data volume by 2028
Zero of it is useful raw.
Every insight starts by describing the data first.
Descriptive statistics is not a preliminary step you rush through — it is the foundation every good analysis is built on.

Before you build a model, run a hypothesis test, or write a dashboard, you need to know what your data actually looks like. What is a typical value? How spread out are the numbers? Are there outliers? Is the distribution symmetric? Descriptive statistics answers all of these questions — and gets you ready for everything that comes next.

What Is Descriptive Statistics?

Descriptive statistics is the branch of statistics concerned with summarizing and describing the main features of a dataset. Unlike inferential statistics, which uses sample data to draw conclusions about a larger population, descriptive statistics stays within the boundaries of the data you already have — describing what is there, clearly and accurately.

The output is a set of summary numbers and visualizations that replace an overwhelming list of raw values with a coherent, understandable picture. Instead of handing a stakeholder 50,000 rows of customer ages, you give them a mean, a standard deviation, a histogram, and a box plot — and the story is immediately visible.

// KEY DEFINITION
Descriptive statistics transforms raw data into organized summaries using measures of central tendency, variability, shape, and position — without making predictions or generalizations beyond the dataset itself.

Descriptive statistics covers four main categories of measurement, each answering a different question about your data:

CATEGORY 01
Central Tendency
Where is the center of the data? Mean, median, and mode each answer this differently.
What is "typical"?
CATEGORY 02
Variability
How spread out are the values? Range, variance, standard deviation, and IQR quantify the spread.
How much does it vary?
CATEGORY 03
Shape
Is the distribution symmetric? Skewness and kurtosis describe the shape of the distribution.
What does the distribution look like?
CATEGORY 04
Position
Where does a specific value stand relative to others? Percentiles and quartiles answer this.
How does one value compare?

Descriptive vs Inferential Statistics

These two branches are often confused, especially by beginners who encounter both in the same course or project. The distinction is the scope of the conclusion you are drawing.

FeatureDescriptiveInferential
PurposeSummarize the data you haveDraw conclusions about a population
ScopeOnly what is in the datasetBeyond the dataset
OutputsMean, median, charts, tablesp-values, confidence intervals, test statistics
UncertaintyNo — you are describing known dataYes — you are estimating unknown values
First step?AlwaysAfter descriptive analysis is done

In every real data science project, descriptive statistics comes first. You cannot run a meaningful hypothesis test without first understanding the shape, spread, and potential outliers in your data — those properties determine which statistical test is even valid to use.

Types of Variables: What You Can Measure and How

Before applying any descriptive statistic, you need to know what kind of variable you are working with. The type of variable determines which measures and visualizations are appropriate.

Categorical (qualitative) variables represent groups or labels. You can count them, but mathematical operations like averaging are meaningless. Examples: product category, country, customer segment, survey response (yes/no). For these, you use frequency counts, proportions, bar charts, and mode.

Numerical (quantitative) variables represent measurable quantities. These split further into two subtypes. Discrete variables take only specific countable values — number of orders, number of employees, number of page views per session. Continuous variables can take any value within a range — revenue, temperature, time spent on page, customer lifetime value.

// PRACTICAL TIP
Identifying variable type is the first decision in any EDA. Applying a mean to categorical data (like averaging country names) produces nonsense. Applying only a mode to continuous data discards most of the information available.

Measures of Central Tendency

Central tendency answers one question: what is a typical value in this dataset? Three measures answer it in different ways, and choosing the wrong one distorts your picture of the data.

Mean (Arithmetic Average)
Mean = Sum of all values ÷ Number of values
The mean is the most familiar measure. It uses every value in the dataset, which makes it both powerful and sensitive to outliers. A single unusually high salary in a small team will pull the mean upward significantly, making the "average" unrepresentative of what most people earn.
Use when: data is symmetric, no significant outliers, numerical variables
Median (Middle Value)
Middle value when data is sorted. For even count: average of two middle values.
The median is the value that splits the dataset exactly in half. Because it depends only on position — not on the actual values — it is resistant to outliers. House prices and income distributions almost always use the median for this reason: a few extreme high values would inflate the mean dramatically, while the median stays representative of the typical case.
Use when: skewed data, outliers present, income or price data
Mode (Most Frequent Value)
The value (or values) that appears most often in the dataset.
The mode is the only measure of central tendency that works for categorical data. It is also the only one a dataset can have multiple of — a bimodal distribution has two peaks, suggesting two distinct subgroups may exist within the data. In machine learning, the mode is used for imputing missing values in categorical columns.
Use when: categorical data, identifying most common category, bimodal distributions

Measures of Variability (Spread)

Two datasets can share the same mean and still look completely different. Variability measures capture the spread — how tightly clustered or widely scattered the data points are around the center.

Range
Range = Maximum value − Minimum value
The range is the simplest measure of spread. It is fast to compute and immediately gives you the full extent of the data. The limitation is that it uses only two data points and is completely dominated by outliers — a single extreme value changes the range dramatically while leaving the distribution of the middle 98% of data unchanged.
Use when: quick summary, no significant outliers
Variance
Variance = Average of squared differences from the mean
Variance uses every data point and measures the average squared distance from the mean. Squaring the differences ensures positive and negative deviations do not cancel out, and it gives more weight to larger deviations. The drawback is that the unit is squared (square dollars, square meters), which is hard to interpret directly.
Use when: mathematical calculations, computing standard deviation
Standard Deviation
Standard Deviation = Square root of variance
Standard deviation is the most widely used measure of variability. Taking the square root of variance brings the unit back to the original data's scale — dollars, meters, minutes — making it directly interpretable. A low standard deviation means data clusters tightly around the mean. A high one means it is widely spread. In a normal distribution, roughly 68% of data falls within one standard deviation of the mean, and 95% within two.
Use when: numerical data, alongside the mean, symmetric distributions
Interquartile Range (IQR)
IQR = Q3 (75th percentile) − Q1 (25th percentile)
The IQR measures the spread of the middle 50% of data, completely ignoring the bottom quarter and top quarter. This makes it resistant to outliers — those extreme values sit outside the IQR by definition. The IQR is also the foundation of the box plot and is used in the standard outlier detection rule: any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR is flagged as a potential outlier.
Use when: skewed data, alongside the median, outlier detection

Shape of a Distribution: Skewness and Kurtosis

The mean and standard deviation describe the center and spread of a distribution, but they cannot tell you its shape. Two distributions can have identical means and standard deviations but look completely different. Skewness and kurtosis quantify that shape.

Skewness

Skewness measures how asymmetric a distribution is. A perfectly symmetric distribution (like a normal bell curve) has a skewness of zero. A positive skew (right-skewed) means a long tail extends to the right — most values cluster on the left, but a few very high values pull the tail outward. Income is the classic example: most people earn moderate amounts, but a small number of very high earners create a long right tail. A negative skew (left-skewed) is the mirror — a long tail extending to the left.

Skewness matters because it changes which measure of central tendency is most representative. In a positively skewed distribution, the mean is pulled toward the tail and above the median — so the median is a better "typical value." In machine learning, high skewness often signals that a log transformation would improve model performance.

Kurtosis

Kurtosis measures the "tailedness" of a distribution — how heavy or light the tails are compared to a normal distribution. Leptokurtic distributions (high kurtosis) have heavier tails and a sharper central peak, meaning extreme values are more common than a normal distribution predicts. Financial returns are often leptokurtic — crashes and booms happen more often than a normal model would suggest. Platykurtic distributions (low kurtosis) have lighter tails and a flatter peak, meaning extreme values are rare.

// IMPORTANT FOR ML
Machine learning algorithms that assume normality (like linear regression, LDA, and many anomaly detectors) can perform poorly on highly skewed or leptokurtic data. Always check skewness and kurtosis during EDA before choosing a modeling approach.

Measures of Position: Percentiles and Quartiles

Measures of position tell you where a specific value stands relative to the rest of the dataset. They do not describe the whole distribution — they describe individual data points in context.

Percentiles divide a sorted dataset into 100 equal parts. The 90th percentile is the value below which 90% of the data falls. If a student's test score is at the 85th percentile, they scored higher than 85% of other students — regardless of the actual score. Percentiles are used constantly in reporting: page load time at the 95th percentile (p95), income at the 50th percentile (the median), and growth benchmarks.

Quartiles divide a sorted dataset into four equal parts: Q1 (25th percentile), Q2 (50th percentile — the median), and Q3 (75th percentile). These three values, combined with the minimum and maximum, form the five-number summary that underpins the box plot visualization.

MeasureDefinitionCommon use
Q1 (25th percentile)25% of data falls below this valueLower bound of IQR
Q2 (50th percentile)The median — 50% falls belowCentral tendency for skewed data
Q3 (75th percentile)75% of data falls below this valueUpper bound of IQR
p95 / p9995% or 99% of data falls belowPerformance monitoring, SLA thresholds

Frequency Distributions

A frequency distribution shows how often each value (or range of values) appears in a dataset. It turns a raw list of numbers into a structured summary of how the data is distributed across its range.

For categorical data, a frequency table simply counts how many times each category appears and what proportion of the total it represents. For continuous numerical data, the values are grouped into bins — equal-width intervals — and the count within each bin is recorded. The result is a histogram when visualized, which reveals the shape of the distribution at a glance: whether it is symmetric, skewed, bimodal, or uniform.

Frequency distributions are also the starting point for identifying data quality issues. A bin with unexpectedly high frequency might indicate data entry errors. A completely flat distribution where you would expect a peak suggests the data source is unreliable. Checking the frequency distribution is one of the first steps in any serious data cleaning process.

Python: Computing Descriptive Statistics

Python makes descriptive statistics fast with Pandas and NumPy. Here are the patterns you will use in every real project.

Core summary statistics with Pandas

descriptive_stats.py
import pandas as pd
import numpy as np

# Sample dataset: daily sales figures
data = {
    'sales': [450, 380, 520, 490, 610, 320, 580,
              410, 550, 470, 390, 720, 430, 510]
}
df = pd.DataFrame(data)

# One-line summary of all numeric columns
print(df.describe())

# Individual statistics
print(f"Mean:   {df['sales'].mean():.2f}")
print(f"Median: {df['sales'].median():.2f}")
print(f"Mode:   {df['sales'].mode()[0]}")
print(f"Std:    {df['sales'].std():.2f}")
print(f"Var:    {df['sales'].var():.2f}")
print(f"Range:  {df['sales'].max() - df['sales'].min()}")

# IQR calculation
q1 = df['sales'].quantile(0.25)
q3 = df['sales'].quantile(0.75)
iqr = q3 - q1
print(f"IQR:    {iqr:.2f}")

Skewness and kurtosis

shape_stats.py
from scipy import stats

sales = [450, 380, 520, 490, 610, 320, 580,
         410, 550, 470, 390, 720, 430, 510]

skewness = stats.skew(sales)
kurt = stats.kurtosis(sales)

print(f"Skewness: {skewness:.3f}")
print(f"Kurtosis: {kurt:.3f}")

# Interpretation
if abs(skewness) < 0.5:
    print("Approximately symmetric — mean is reliable")
elif skewness > 0.5:
    print("Right-skewed — consider median over mean")
else:
    print("Left-skewed — consider median over mean")

Outlier detection using IQR

outlier_detection.py
import pandas as pd
import numpy as np

df = pd.DataFrame({'sales': [450, 380, 520, 1800,
                              490, 610, 320, 580]})

q1 = df['sales'].quantile(0.25)
q3 = df['sales'].quantile(0.75)
iqr = q3 - q1

lower_bound = q1 - 1.5 * iqr
upper_bound = q3 + 1.5 * iqr

outliers = df[(df['sales'] < lower_bound) |
              (df['sales'] > upper_bound)]

print(f"Lower bound: {lower_bound:.0f}")
print(f"Upper bound: {upper_bound:.0f}")
print(f"Outliers:\n{outliers}")

Python: Visualizing Descriptive Statistics

The right visualization depends on variable type and what aspect of the data you need to show. Here are the four most important plots in descriptive analysis.

visualizations.py
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np

np.random.seed(42)
data = np.random.normal(loc=500, scale=80, size=200)
df = pd.DataFrame({'sales': data})

fig, axes = plt.subplots(2, 2, figsize=(12, 9))

# 1. Histogram with KDE
sns.histplot(df['sales'], kde=True,
             ax=axes[0,0], color='steelblue')
axes[0,0].set_title('Histogram with KDE')
axes[0,0].axvline(df['sales'].mean(), color='red',
                    linestyle='--', label='Mean')
axes[0,0].axvline(df['sales'].median(), color='green',
                    linestyle='--', label='Median')
axes[0,0].legend()

# 2. Box plot
sns.boxplot(y=df['sales'], ax=axes[0,1], color='steelblue')
axes[0,1].set_title('Box Plot (IQR & Outliers)')

# 3. Violin plot
sns.violinplot(y=df['sales'], ax=axes[1,0], color='steelblue')
axes[1,0].set_title('Violin Plot (Distribution Shape)')

# 4. ECDF (Empirical Cumulative Distribution)
sns.ecdfplot(df['sales'], ax=axes[1,1], color='steelblue')
axes[1,1].set_title('ECDF (Percentile View)')

plt.tight_layout()
plt.savefig('descriptive_stats_plots.png', dpi=150)
plt.show()

Here is when to use each plot type:

NUMERICAL
Histogram
Shows distribution shape, center, and spread. Best for understanding the overall frequency pattern of a continuous variable.
Use for: any numerical variable, first look at distribution
NUMERICAL
Box Plot
Shows Q1, median, Q3, IQR, and outliers (as individual points). Best for comparing distributions across groups or spotting outliers quickly.
Use for: comparing groups, outlier detection
CATEGORICAL
Bar Chart
Shows frequency or proportion for each category. Best for comparing counts or proportions across a discrete set of groups.
Use for: categorical variables, frequency tables
NUMERICAL
Violin Plot
A combination of box plot and KDE — shows both the summary statistics and the full shape of the distribution. Better than a box plot alone when distribution shape matters.
Use for: showing distribution shape alongside spread

Choosing the Right Measure

SituationCentral tendencySpreadVisualization
Symmetric data, no outliersMeanStandard deviationHistogram, violin plot
Skewed data or outliersMedianIQRBox plot
Categorical dataModeFrequency / proportionBar chart
Comparing groupsMean or median per groupStd or IQR per groupGrouped box plot
Finding outliersMedianIQR (1.5× rule)Box plot

Role in Exploratory Data Analysis and Machine Learning

Descriptive statistics is the engine of exploratory data analysis (EDA) — the stage where data scientists get to know a dataset before modeling it. A well-done EDA catches data quality problems, shapes feature engineering decisions, and often reveals the most important patterns before any model is trained.

  • Data cleaning — the mean, IQR, and range quickly reveal impossible values (negative ages, 200% conversion rates) and potential entry errors
  • Feature engineering — knowing a feature is heavily right-skewed tells you a log transformation might normalize it and improve model performance
  • Missing value imputation — whether to impute with mean or median depends on whether the distribution is symmetric or skewed
  • Scaling decisions — standard deviation determines the normalization factor in standardization (Z-score scaling)
  • Algorithm selection — high kurtosis suggests tree-based models may outperform linear ones, which assume near-normality
  • Outlier handling — the IQR rule identifies points to investigate before deciding whether to remove, cap, or keep them
// KEY PRINCIPLE
Descriptive statistics does not just describe data — it informs every decision that comes after it. A data scientist who skips EDA typically spends twice as long debugging model problems that a good descriptive analysis would have caught in the first hour.

Common Mistakes to Avoid

!

Using mean on skewed data: Income, house prices, and session duration are almost always right-skewed. Reporting the mean implies a typical value that most people never experience. Use median instead.

!

Ignoring the standard deviation: Two groups can have the same mean and completely different spreads. Always report spread alongside center — one number without the other tells an incomplete story.

!

Applying numerical statistics to categorical data: The mean of a column coded as 1=Male, 2=Female is statistically meaningless. Know your variable types before calculating anything.

!

Skipping skewness checks: Feeding a heavily skewed feature into a linear model without transformation inflates errors. Skewness and kurtosis are quick checks that save significant modeling time.

!

Treating df.describe() as the whole EDA: Pandas describe() gives mean, std, and quartiles — but not skewness, kurtosis, or the frequency distribution. Always visualize as well.

Frequently Asked Questions

What is descriptive statistics in simple terms?

Descriptive statistics is the process of summarizing and describing the main features of a dataset using numbers and visualizations — things like averages, spread, and frequency distributions — without drawing conclusions beyond the data you already have.

What is the difference between mean, median, and mode?

The mean is the mathematical average of all values. The median is the middle value when data is sorted. The mode is the most frequently occurring value. Use mean for symmetric data without significant outliers, median when outliers or skewness are present, and mode for categorical data.

What is standard deviation in simple words?

Standard deviation measures how spread out data points are from the mean. A small standard deviation means data is clustered closely around the average. A large one means it is widely scattered. In a normal distribution, about 68% of data falls within one standard deviation of the mean.

What is the difference between descriptive and inferential statistics?

Descriptive statistics summarizes the data you already have — no uncertainty or prediction involved. Inferential statistics uses that data to make predictions or test claims about a larger population you did not fully measure, with a calculated degree of uncertainty attached to every conclusion.

Is descriptive statistics used in machine learning?

Yes — throughout the data preparation process. It drives EDA, feature engineering decisions, outlier detection, missing value imputation strategy, normalization choices, and algorithm selection. A well-done descriptive analysis before modeling consistently reduces debugging time later.

Summary: Descriptive Statistics Is Where Every Analysis Starts

Descriptive statistics is not a preliminary step you rush through to get to the "real" work. It is the foundation that every subsequent decision — which model to train, which features to engineer, which outliers to remove, which transformation to apply — is built on.

The core ideas are straightforward: central tendency (mean, median, mode) tells you where the data clusters; variability (range, standard deviation, IQR) tells you how spread it is; skewness and kurtosis describe the shape; percentiles and quartiles tell you how individual values compare to the group. Python makes computing and visualizing all of these fast — but knowing which measure to reach for, and why, is the judgment that separates a good analysis from a misleading one.

// NEXT STEPS
Continue to Inferential Statistics in Data Science to learn how to go beyond describing the data and start testing hypotheses and making predictions. Then revisit your own datasets and run df.describe(), check skewness, and build a box plot — there is always something unexpected.

Khalid Hussain

Founder of Review Publically. Holds a Master's in Computer Science with professional training in Google Advanced Data Analytics, Python, NumPy, and Seaborn. Writes and maintains the site's Data Science and Statistics learning tracks.