O'Reilly logo

Learning pandas - Second Edition 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

Reading stock data from Yahoo! and Google Finance

First, I want to say that unfortunately, Yahoo! has changed their API and currently this breaks the implementation in pandas-datareader. It is not known if this will be fixed. Therefore, the examples will only use Google Finance.

To use the pandas-datereader package, we use the following import:

Stock data from Google Finance can then be objected using the DataReader function by passing it the stock symbol, the data source (in this case, 'google'), and the start and end dates:

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