Statistics & Probability: lesson 1 of 5
Statistics & Probability
Descriptive Statistics and Data Distributions
Learn how descriptive statistics summarize data and how distributions reveal patterns hidden in raw tables.
Concept
Statistics is a way to learn from data. Descriptive statistics summarize the data you have; inferential statistics use a sample to reason carefully about a larger population. An observation is one row, a variable is a recorded characteristic, and a dataset is the collection of observations and variables.
Why It Matters
Raw tables are hard to reason about. A thousand customer-spend values do not immediately reveal typical spending, unusual values, or whether a small group behaves differently. Summaries and distributions make the structure visible before a business decision or model is attempted.
Intuition
A distribution answers: “How are values arranged?” It shows frequency, center, spread, and shape. A table can tell you each delivery time; a distribution can show whether most deliveries cluster near 30 minutes with a small number of very late orders.
Variables and Distributions
Numerical variables measure quantities such as salary, spend, delivery time, or test score. Categorical variables place observations into groups such as region, subscription plan, or product category. A distribution for a numerical variable shows how values occur across a scale; for a category, it shows counts or percentages by group.
Real-World Example
Imagine monthly customer spending: [20, 25, 30, 35, 40, 220]. The table has six values, but a distribution reveals that most customers spend 20–40 while one spends far more. Reporting only the total, 370, would not describe a typical customer.
Useful summaries include count, minimum, maximum, mean, median, and quartiles. In Pandas, describe() provides many of these for numeric columns. It is a starting point for questions, not a substitute for understanding the business definition of each field.
Shape, Center, and Spread
A symmetric distribution has roughly balanced sides around its center. A right-skewed distribution has a long high-value tail, common for income or transaction amounts. A left-skewed distribution has a longer low-value tail. A multimodal distribution has more than one peak, which may indicate distinct groups such as budget and premium customers.
Center describes a typical value; spread describes how variable values are. Two stores can have the same average revenue but very different consistency. Shape matters because a mean can be pulled by a long tail and can hide multiple groups.
Technical / Practical Explanation
For a numerical column, begin with count and missingness, then minimum, maximum, median, and quartiles. Compare those numbers with a histogram or box plot when possible. For categories, inspect counts and percentages. Always ask whether each row represents the same unit: one customer, one order, or one day.
When to Use It
Use descriptive statistics at the start of exploratory data analysis, when checking a new dataset, comparing segments, validating features, or explaining a business outcome. Use inferential thinking later when a sample must represent a population or an experiment result must be evaluated.
Failure Signals
Common Mistakes
- Treating a mean as the complete story.
- Ignoring missing values and row meaning.
- Comparing groups with very different sample sizes without noting it.
- Assuming a visually unusual value is an error.
Best Practices
Combine summaries with visual inspection and domain context. Report sample size with any average, separate clearly defined segments, and investigate extreme values before removing them. Check distributions before applying a method that assumes a particular shape.
Data Science Perspective
Distribution checks support cleaning, anomaly detection, feature engineering, experimentation, and model evaluation. A feature distribution that changes sharply between training and live data can signal a problem even before model performance is measured.
Interview Perspective
Question: Why is a table of raw values not enough? A strong answer: summaries and distributions reveal typical values, spread, outliers, and group structure that are difficult to see from individual rows.
Practice Questions
- Is customer region numerical or categorical? What summary would you use?
- A delivery-time distribution has a long right tail. What does that suggest?
- Why might a multimodal salary distribution deserve segmentation?
Quick Quiz
- What does descriptive statistics summarize? Answer: the observed data.
- Which shape is common for transaction amounts? Answer: right-skewed.
- What does a distribution show beyond a count? Answer: frequency, center, spread, and shape.
Worked Interpretation: Customer Spending
Suppose monthly spending is 12, 18, 21, 25, 31, 35, 42, 48, 310. A table is hard to scan, but the right-skewed distribution raises a practical question: is 310 a data error, a wholesale buyer, or a valid high-value customer? Check the transaction, units, customer type, and date before changing it. If it is valid, the median and quartiles may describe a typical retail customer better than the mean, and wholesale customers may deserve a separate analysis.
Choosing a Useful Summary
Match the summary to the decision. count tells you how many usable records exist; min and max can expose impossible ages or negative revenue. Mean and median describe typical numeric values differently, while frequency counts are usually better for a category such as region. Check group sizes before comparing rates: 20% conversion from five visitors is much less stable than 20% from five thousand. Descriptive statistics reveal patterns and context, but they do not establish why a pattern occurred.
Key Takeaway
Key Takeaways
Descriptive statistics turn raw values into a readable picture. Distribution shape, spread, and sample context are as important as a single average.
Next Lesson
Next, learn the measures of center and spread used to describe typical values, variation, and outliers.
Finish this lesson on your terms
Mark it complete when you have worked through the material and are ready to move on.