Exploring the pandas_datareader Python library
pandas_datareader
is one of the most advanced libraries for financial data and offers access to multiple data sources.
Some of the data sources supported are as follows:
- Yahoo Finance
- The Federal Reserve Bank of St Louis' FRED
- IEX
- Quandl
- Kenneth French's data library
- World Bank
- OECD
- Eurostat
- Econdb
- Nasdaq Trader symbol definitions
Refer to https://pandas-datareader.readthedocs.io/en/latest/remote_data.html for a full list.
Installation is simple:
pip install pandas-datareader
Let's now set up the basic data retrieval parameters:
from pandas_datareader import data start_date = '2010-01-01' end_date = '2020-12-31'
The general access method for downloading the data is data.DataReader(ticker, data_source, start_date, end_date)
.
Access to Yahoo Finance
Let's download the last 10 years' worth of Apple stock prices:
aapl...