Introduction to Statistics in Python | by Donald Le | Towards Data Science

Statistics is the discipline that concerns the collection, organization, analysis, interpretation and presentation of data. In applying statistics to a scientific, industrial, or social problem, it is conventional to begin with a statistical population or a statistical model to be studied.
is a central or typical value for a probability distribution. It may also be called a center or location of the distribution. Colloquially, measures of central tendency are often called averages.
is the extent to which a distribution is stretched or squeezed. Common examples of measures of statistical dispersion are the variance, standard deviation, and interquartile range.
or dependence is any statistical relationship, whether causal or not, between two random variables or bivariate data. In the broadest sense correlation is any statistical association, though it commonly refers to the degree to which a pair of variables are linearly related.
which goes by several names, is a phenomenon in probability and statistics, in which a trend appears in several different groups of data but disappears or reverses when these groups are combined.
Data Analytics solutions offer a convenient way to leverage business data. But the number of solutions on the market can be daunting — and many may seem to cover a different category of analytics. How can organizations make sense of it all? Start by understanding the different types of analytics, including descriptive, diagnostic, predictive, and prescriptive analytics.
Descriptive Analytics tells you what happened in the past.
Diagnostic Analytics helps you understand why something happened in the past.
Predictive Analytics predicts what is most likely to happen in the future.
Prescriptive Analytics recommends actions you can take to affect those outcomes.
Imagine we have to do some data analysis with the number of friends for each member of our staffs in the work has. The number of friends will be described in a Python list like below :
num_friends = [100, 49, 41, 40, 25, 100, 100, 100, 41, 41, 49, 59, 25, 25, 4, 4, 4, 4, 4, 4, 10, 10, 10, 10,]
We will display the num_friends in Histogram with matplotlib :
Seeing the histogram would be
mean
We would like to get the mean of number of friends
def mean(x):    return sum(x) / len(x)
Apply this method will get the value for number of friends like
35.791666666666664
median
The median is a simple measure of central tendency. To find the median, we arrange the observations in order from smallest to largest value. If there is an odd number of observations, the median is the middle value. If there is an even number of observations, the median is the average of the two middle values.
Apply this method will give us the result
25.0
quantile
A generalization of the median is the quantile, which represents the value less than which a certain percentile of the data lies. (The median represents the value less than which 50% of the data lies.)
def quantile(x, p):    """returns the pth-percentile value in x"""    p_index = int(p * len(x))    return sorted(x)[p_index]
Apply quantile method with num_friends for the percentile is 0.8 would have result
59
mode (or most common values)
Apply mode method for num_friends will return
[4]
Studying about statistics help us know more about the fundamentals concept of Data Analysis or Data Science in general. There’s a lot more about statistics like Hypothesis testing, Correlation, or Estimation which I have not went over. So feel free to learn more about them.
Data Science from Scratch book — by Joel Grus