Selecting a single column is accomplished by passing the desired column name as a string to the indexing operator of a DataFrame. This was covered in the Selecting a Series recipe in Chapter 1, Pandas Foundations. It is often necessary to focus on a subset of the current working dataset, which is accomplished by selecting multiple columns.
Selecting multiple DataFrame columns
Getting ready
In this recipe, all the actor and director columns will be selected from the movie dataset.
How to do it...
- Read in the movie dataset, and pass in a list of the desired columns to the...