December 2017
Intermediate to advanced
386 pages
10h 42m
English
Selecting the data in specific columns of a DataFrame is performed by using the [] operator. This differs from a Series, where [] specifies rows. The [] operator can be passed either a single object or a list of objects representing the columns to retrieve.
The following retrieves the column with the name Sector:

When a single column is retrieved from a DataFrame, the result is a Series:
Multiple columns can be retrieved by specifying a list of column names:
Since this has multiple columns, the result is a DataFrame instead ...
Read now
Unlock full access