O'Reilly logo

Mastering pandas for Finance by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Obtaining historical stock and index data

The examples will use two sets of data obtained from Yahoo! Finance. The first one is a series of stock values for several stocks over the calendar years 2012–2014. The second set of data is the S&P 500 average over the same period. Note that although we are using data from a fixed period in time, the adjusted close values tend to change slightly over time, so there may be slight differences in output when you run the code as compared to what is in the text.

Fetching historical stock data from Yahoo!

The examples in this chapter will use historical quotes for Apple (AAPL), Microsoft (MSFT), General Electric (GE), IBM (IBM), American Airlines (AA), Delta Airlines (DAL), United Airlines (UAL), Pepsi (PEP

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required