Example data

Where possible, the examples in this chapter will utilize several datasets provided with the code in the download for the text. These datasets make the examples a little less academic in nature. These datasets will be read from files using the pd.read_csv() function that will load the sample data from the file into a DataFrame object.


pd.read_csv() will be more extensively examined in Chapter 6, Accessing Data. For now, its function is simply to load some example DataFrame objects.

The remainder of the samples will still utilize the DataFrame objects created on demand if they demonstrate the concept being examined in a better way. Let's see the brief descriptions of these datasets.

S&P 500

The first dataset we will use is a snapshot ...

Get Learning pandas now with O’Reilly online learning.

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