Understanding the Role of Statistics in Data Science
Statistics and probability help data scientists understand datasets, measure uncertainty, identify patterns, and make decisions based on evidence. They are essential for exploratory data analysis, hypothesis testing, experimentation, and machine learning.
Statistics focuses on collecting, summarizing, and interpreting data. Probability provides a mathematical framework for understanding uncertainty and the likelihood of events.
Descriptive and Inferential Statistics
Descriptive statistics summarize the data you already have. Examples include the mean salary of employees, the median delivery time, and the percentage of customers who make repeat purchases.
Inferential statistics use information from a sample to draw conclusions about a larger population. For example, a company might survey 500 customers to estimate the satisfaction level of all its customers.
Python makes these calculations easier with libraries such as Pandas, NumPy, and SciPy.
Calculating Basic Statistics with Python
Consider a dataset containing the marks obtained by students.
import pandas as pd
marks = pd.Series([65, 70, 75, 80, 85, 90, 95])
print("Mean:", marks.mean())
print("Median:", marks.median())
print("Minimum:", marks.min())
print("Maximum:", marks.max())
print("Standard deviation:", marks.std())
The mean gives the average score, while the median identifies the middle value. The minimum and maximum show the range of observed scores, and the standard deviation indicates how much the scores vary around their mean.
You can calculate several descriptive statistics together:
print(marks.describe())
The describe() method returns a compact statistical summary, including the count, mean, standard deviation, quartiles, minimum, and maximum.
Python for Data Science
Vishalini A








