Statistics for Data Science: What Beginners Should Learn First
Quick answer
The five statistics skills a data science beginner needs, each shown with a small worked example in Python and a plain-language interpretation.
Statistics for data science comes down to five skills: describing data with the right summary, reasoning with probability, understanding how samples behave, testing whether a difference is real, and measuring relationships between variables. A beginner who can do these five on a small dataset, and explain the result in plain words, has enough statistics to start analysis and machine learning work.
Key takeaways
- Start with descriptive statistics and probability. Hypothesis tests make no sense until those are solid.
- Report the median alongside the mean whenever data is skewed. Indian salary data is a classic case.
- A p-value is not the probability that your hypothesis is true. The American Statistical Association said so explicitly in 2016.
- Learn each idea by computing it once by hand and once in Python. The code is short, the understanding is the hard part.
On this page:
- Which statistical tool answers which question?
- How do you describe a dataset honestly?
- How much probability do you need?
- Why do samples and confidence intervals matter?
- How does a hypothesis test work?
- What does correlation tell you, and what does it hide?
- In what order should a beginner learn statistics?
- Frequently asked questions
Which statistical tool answers which question?
Pick the tool from the question you are asking, not from a syllabus. This table covers what most entry-level data work requires.
| Your question | Concept | Python starting point |
|---|---|---|
| What is a typical value? | Mean, median, mode | np.mean, np.median |
| How spread out is it? | Standard deviation, percentiles | np.std(x, ddof=1), np.percentile |
| How likely is this event given that one? | Conditional probability, Bayes' rule | Plain arithmetic |
| How sure am I about this average? | Standard error, confidence interval | scipy.stats.sem, stats.t.interval |
| Is the difference between two groups real? | Hypothesis test, p-value | scipy.stats.ttest_ind |
| Do two variables move together? | Correlation | np.corrcoef |
| Can I predict one from the other? | Regression | scikit-learn or statsmodels |
How do you describe a dataset honestly?
Give a measure of centre and a measure of spread, and choose the centre based on the shape of the data. The mean is pulled by extreme values. The median is not.
Illustrative example: eight graduates from one batch report these annual packages in lakh rupees. Seven are between 4.2 and 6.0, and one person joined a firm abroad at 32.
import numpy as np
salaries = np.array([4.2, 4.5, 4.8, 5.0, 5.1, 5.5, 6.0, 32.0])
print(salaries.mean()) # 8.3875
print(np.median(salaries)) # 5.05
print(salaries.std(ddof=1)) # 9.557...
"Average package 8.39 lakh" is arithmetically true and misleading: seven of the eight earn less than that. "Median 5.05 lakh" describes the typical graduate. The NIST/SEMATECH e-Handbook of Statistical Methods makes the same point about heavy-tailed data, concluding that the median provides a better estimate of location than does the mean in that case. Whenever you read a placement or salary claim, ask which of the two it is.
Standard deviation in one line
It is the typical distance of values from the mean. Here it is 9.56, larger than the mean itself, which is a warning that one value dominates. Use ddof=1 when your data is a sample from a larger group.
How much probability do you need?
You need the basic rules, conditional probability and Bayes' rule, plus a feel for the normal and binomial distributions. Bayes' rule is the one that changes how you think, so work it through with counts.
Illustrative scenario: a screening test for a condition that 1% of people have. The test catches 95% of real cases and wrongly flags 5% of healthy people. Someone tests positive. What is the chance they have the condition?
- Imagine 10,000 people. 100 have the condition, 9,900 do not.
- Of the 100, the test flags 95.
- Of the 9,900, the test wrongly flags 5%, which is 495.
- Total positives = 95 + 495 = 590.
- Chance a positive is real = 95 / 590 = 16.1%.
Most people guess above 90%. The low base rate is what pulls the answer down. The same logic explains why a fraud model with good accuracy still raises many false alarms, a point that returns in machine learning interview questions about precision and recall.
Why do samples and confidence intervals matter?
Because you almost never see the whole population, and a sample average wobbles from sample to sample. A confidence interval puts numbers on that wobble.
Two ideas to hold on to:
- Standard error is the standard deviation divided by the square root of the sample size. Four times the data halves the uncertainty, it does not quarter it.
- The central limit theorem says that averages of reasonably large samples follow an approximately normal distribution even when the raw data does not. This is why so many methods built on the normal curve work in practice.
Illustrative example: delivery times in minutes for ten orders under a new route plan.
from scipy import stats
new = np.array([28, 27, 31, 30, 26, 29, 32, 27, 25, 30])
low, high = stats.t.interval(0.95, df=len(new) - 1,
loc=new.mean(), scale=stats.sem(new))
print(new.mean(), round(low, 2), round(high, 2)) # 28.5 26.87 30.13
Report it as "mean 28.5 minutes, 95% confidence interval 26.9 to 30.1". With ten orders the interval is wide. That width is information: it tells the reader how much to trust the average.
How does a hypothesis test work?
You assume there is no real difference (the null hypothesis), then ask how surprising your data would be if that were true. The p-value measures that surprise.
Continue the example. The old route plan gave these times for ten other orders:
old = np.array([31, 29, 35, 33, 30, 34, 32, 36, 28, 33])
res = stats.ttest_ind(old, new, equal_var=False)
print(old.mean(), new.mean()) # 32.1 28.5
print(round(res.statistic, 2), round(res.pvalue, 4)) # 3.3 0.0041
The SciPy documentation describes ttest_ind as a test for the means of two independent samples, and equal_var=False runs Welch's t-test, which does not assume the two groups have equal variance.
Reading the result correctly
The p-value of 0.0041 means: if the two plans truly had the same average time, a gap this large would appear in well under 1% of such samples. It is below the common 0.05 threshold, so you reject "no difference". The NIST handbook notes that it is good practice to decide in advance how small a p-value you require, before looking at the data.
Now the cautions. The American Statistical Association's 2016 statement on statistical significance and p-values lists six principles, including these two: p-values do not measure the probability that the studied hypothesis is true, and a p-value does not measure the size of an effect or the importance of a result. So also report the effect: 3.6 minutes faster on average. Then ask the practical question: were the two sets of orders comparable in distance, time of day and weather? No test fixes a bad comparison.
What does correlation tell you, and what does it hide?
Correlation measures how closely two variables follow a straight-line relationship, on a scale from -1 to +1. It says nothing about cause.
hours = np.array([2, 4, 5, 7, 8, 10]) # weekly practice hours, illustrative
score = np.array([45, 50, 62, 70, 74, 88]) # test score
print(np.corrcoef(hours, score)[0, 1].round(3)) # 0.988
A value of 0.988 is a very strong positive relationship in this tiny sample. Three checks before you write a conclusion:
- Plot it. A curve or a single outlier can produce a misleading number.
- Look for a third factor. Students who practise more may also attend more classes.
- Check the direction. Do high scorers practise more because they enjoy it?
Only a designed experiment, such as randomly assigning the new route plan to half the orders, supports a causal claim. For worked cases, see these real-world data analysis examples.
In what order should a beginner learn statistics?
Follow the dependency chain: description, probability, sampling, testing, regression. Skipping ahead to tests without the first three is the most common reason people find statistics confusing.
- Descriptive statistics: centre, spread, percentiles, histograms, box plots.
- Probability: rules, conditional probability, Bayes, binomial and normal distributions.
- Sampling: standard error, central limit theorem, confidence intervals.
- Hypothesis testing: null and alternative, p-values, t-test, chi-square test, A/B testing.
- Relationships: correlation, simple and multiple linear regression.
Do each stage in code as well as on paper. The NumPy tutorial for beginners covers the array operations used above, and Python for data analysis shows how to apply them to real tables. If machine learning is your goal, continue with maths for machine learning, and see where statistics sits in the wider data scientist roadmap.
Next step: take any dataset with two groups, such as marks from two sections, and produce four things: mean and median for each, a confidence interval, a Welch's t-test, and one paragraph explaining the result to a non-technical reader. For a taught route into data science and machine learning, the Artificial Intelligence and Machine Learning programme from Vishlesan i-Hub, IIT Patna runs for 08 months.
Frequently asked questions
How much statistics is needed for data science?
For entry-level work you need descriptive statistics, basic probability including Bayes' rule, sampling and confidence intervals, hypothesis testing and linear regression. Research and specialist roles go deeper into inference, experimental design and Bayesian methods.
Can I learn statistics for data science without a maths background?
Yes. School-level algebra is enough to begin. Work with small datasets, calculate by hand first, then check with Python. Commerce and arts graduates regularly learn this material when it is tied to real examples.
What is a p-value in simple terms?
It is the probability of seeing data at least as extreme as yours if the null hypothesis were true. A small p-value means the data would be surprising under that assumption. It is not the probability that your hypothesis is correct.
What is the difference between descriptive and inferential statistics?
Descriptive statistics summarise the data you have, using measures such as mean, median and standard deviation. Inferential statistics use a sample to draw conclusions about a larger population, using confidence intervals and hypothesis tests.
Should I use the mean or the median?
Use the mean for roughly symmetric data without extreme values. Use the median when the data is skewed or has outliers, such as incomes, house prices or delivery times. When in doubt, report both and show a histogram.