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

Pandas DataReader


This may be a really simple question but I am truly stuck. I am trying to call Pandas' DataReader like:

from pandas.io.date import DataReader

but it does not get DataReader. I do not know what I am doing wrong, especially for such a simple thing. All I am trying to do is to acquire data from Yahoo Finance.

Thanks a lot for the help.


Solution

  • Pandas data reader was removed from pandas, it is now a separate repo and a separate install

    https://github.com/pydata/pandas-datareader

    From the readme.

    Starting in 0.19.0, pandas no longer supports pandas.io.data or pandas.io.wb, so you must replace your imports from pandas.io with those from pandas_datareader:

    from pandas.io import data, wb # becomes
    from pandas_datareader import data, wb
    

    Many functions from the data module have been included in the top level API.

    import pandas_datareader as pdr
    pdr.get_data_yahoo('AAPL')