Book Image

Mastering pandas

By : Femi Anthony
Book Image

Mastering pandas

By: Femi Anthony

Overview of this book

<p>Python is a ground breaking language for its simplicity and succinctness, allowing the user to achieve a great deal with a few lines of code, especially compared to other programming languages. The pandas brings these features of Python into the data analysis realm, by providing expressiveness, simplicity, and powerful capabilities for the task of data analysis. By mastering pandas, users will be able to do complex data analysis in a short period of time, as well as illustrate their findings using the rich visualization capabilities of related tools such as IPython and matplotlib.</p> <p>This book is an in-depth guide to the use of pandas for data analysis, for either the seasoned data analysis practitioner or the novice user. It provides a basic introduction to the pandas framework, and takes users through the installation of the library and the IPython interactive environment. Thereafter, you will learn basic as well as advanced features, such as MultiIndexing, modifying data structures, and sampling data, which provide powerful capabilities for data analysis.</p>
Table of Contents (18 chapters)
Mastering pandas
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Measures of central tendency and variability


Some of the measures used in descriptive statistics include the measures of central tendency and measures of variability.

A measure of central tendency is a single value that attempts to describe a dataset by specifying a central position within the data. The three most common measures of central tendency are the mean, median, and mode.

A measure of variability is used to describe the variability in a dataset. Measures of variability include variance and standard deviation.

Measures of central tendency

Let's take a look at the measures of central tendency and an illustration in the following sections.

The mean

The mean or sample is the most popular measure of central tendency. It is equal to the sum of all values in the dataset divided by the number of values in the dataset. Thus, in a dataset of n values, the mean is calculated as follows:

We use if the data values are from a sample and μ if the data values are from a population.

The sample mean and...