The axis keyword

We can also use the axis keyword in a filtering method. Here, we filter by regex Region, with axis set to column:

data.filter(regex='Region', axis=1).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.