Search code examples
python-3.xpandasyahoo-financepandas-datareader

In the remote data access code for Pandas tutorial, what does "F" mean?


In [12]: import pandas_datareader.data as web

In [13]: import datetime

In [14]: start = datetime.datetime(2010, 1, 1)

In [15]: end = datetime.datetime(2013, 1, 27)

In [16]: f = web.DataReader("F", 'yahoo-dividends', start, end)

Solution

  • The API documentation is sadly lacking in the generated docs for pandas_datareader. However, the functions themselves are pretty well documented in the source code. Looking at the source for DataReader, the first parameter is name:

    the name of the dataset. Some data sources (google, fred) will accept a list of names.

    This is not informative, but digging deeper, into the classes of objects that DataReader actually returns, like YahooDailyReader, and how they are constructed, the first parameter is the stock symbol or symbols:

    Single stock symbol (ticker), array-like object of symbols or DataFrame with index containing stock symbols.

    In this case, 'F' is the symbol for Ford. With the yahoo data source, you have the option of supplying a single string or an iterable of strings to get multiple outputs at once.