Performing statistical processes on pandas objects
Descriptive statistics gives us the ability to understand numerous measures of data that describe a specific characteristic of the underlying data. Built into pandas are several classes of these descriptive statistical operations that can be applied to a Series or DataFrame.
Let's examine several facets of statistical analysis / techniques provided by pandas:
- Summary descriptive statistics
- Measuring central tendency: mean, median, and mode
- Variance and standard deviation
Retrieving summary descriptive statistics
pandas objects provide the .describe()
method, which returns a set of summary statistics of the object's data. When applied to a DataFrame
, .describe()
will calculate the summary statistics for each column. The following code calculates these statistics for both stocks in omh
.

With one quick method call, we have calculated the count, mean, standard deviation, minimum, and maximum values, and even the 25, 50, and 75 percentiles for both...