Book Image

Hands-On Data Analysis with NumPy and Pandas

By : Curtis Miller
5 (1)
Book Image

Hands-On Data Analysis with NumPy and Pandas

5 (1)
By: Curtis Miller

Overview of this book

Python, a multi-paradigm programming language, has become the language of choice for data scientists for visualization, data analysis, and machine learning. Hands-On Data Analysis with NumPy and Pandas starts by guiding you in setting up the right environment for data analysis with Python, along with helping you install the correct Python distribution. In addition to this, you will work with the Jupyter notebook and set up a database. Once you have covered Jupyter, you will dig deep into Python’s NumPy package, a powerful extension with advanced mathematical functions. You will then move on to creating NumPy arrays and employing different array methods and functions. You will explore Python’s pandas extension which will help you get to grips with data mining and learn to subset your data. Last but not the least you will grasp how to manage your datasets by sorting and ranking them. By the end of this book, you will have learned to index and group your data for sophisticated data analysis and manipulation.
Table of Contents (12 chapters)

Employing array methods and functions


We will now discuss the use of NumPy array methods and functions. In this section, we will look at common ndarray functions and methods. These features allow you to perform common tasks using a clean, intuitive syntax, going beyond the notion of Pythonic code.

Array methods

NumPy ndarray functions include methods that facilitate common tasks, such as finding the mean of a dataset or multiple means of multiple datasets. We can sort array rows and columns, find mathematical and statistical measures, and much more. There are so many functions that do so many things! I won't list them all. In the following, we see the functions needed for common administrative tasks, such as interpreting arrays as lists or sorting array contents:

Next, we see common statistical and mathematical methods, such as finding the mean or sum of array contents:

We also have methods for arrays of Boolean values:

Let's see some of these in a Notebook. Import NumPy and create an array of...