Selecting data from the dataset

We will be selecting the columns from the DataFrame as pandas series, which can be done in two ways. The first method is to use bracket notation for this selection, as seen in the following code block:

regions = data['RegionName'] 

By passing the RegionName column, we will get a series object. This series object will contain the values from this particular column only. How can we be sure this is a series object? We can check that by passing the series object created for the type function, as follows:

type(regions) 

Now, let's also look at the data in the series object we just created:

Let's find out the difference ...

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.