Using the axis parameter in pandas

In this section, we will learn about when and where to use the axis parameter or keyword while doing data analysis in pandas. We'll introduce the axis parameter, and will walk through various values to which the axis keyword can be set to. We will demonstrate how setting axis to rows or columns changes a method's behavior. We'll also show a few code examples for using the axis keyword.

We will start by importing the pandas module and reading the dataset of house prices from zillow.com into the Jupyter Notebook:

data = pd.read_table('data-zillow.csv', sep=',')data.head()

The following is the output:

Get Mastering Exploratory Analysis with pandas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.