title: Python Error: 'DataFrame' object has no attribute 'DataReader'
body: <p>I am learning from a book called &quot;Learn Algorithmic Trading&quot; by Donadio and Ghosh, and I literally copy-and-pasted the code directly from the book:</p>
  <pre><code>from pandas_datareader import data
  
  # Fetch daily data for 4 years, for 7 major currency pairs
  TRADING_INSTRAMENT = 'CADUSD=X'
  SYMBOLS = ['AUDUSD=X', 'GBPUSD=X', 'CADUSD=X', 'CHFUSD=X', 'EURUSD=X', 'JPNUSD=X', 'NZDUSD=X']
  START_DATE = '2014-01-01'
  END_DATE = '2018-01-01'
  
  # DataSeries for each currency
  symbols_data = {}
  for symbol in SYMBOLS:
      SRC_DATA_FILENAME = symbol + '_data.pkl'
  
      try:
          data = pd.read_pickle(SRC_DATA_FILENAME)
      except FileNotFoundError:
          data = data.DataReader(symbol, 'yahoo', START_DATE, END_DATE)
          data.to_pickle(SRC_DATA_FILENAME)
  
      symbols_data[symbol] = data
  </code></pre>
  <p>But I am getting this error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:/Users/cinji/PycharmProjects/LearnAlgorithmicTrading/StatArb.py&quot;, line 16, in &lt;module&gt;
      data = pd.read_pickle(SRC_DATA_FILENAME)
    File &quot;C:\Users\cinji\PycharmProjects\LearnAlgorithmicTrading\venv\lib\site-packages\pandas\io\pickle.py&quot;, line 170, in read_pickle
      f, fh = get_handle(fp_or_buf, &quot;rb&quot;, compression=compression, is_text=False)
    File &quot;C:\Users\cinji\PycharmProjects\LearnAlgorithmicTrading\venv\lib\site-packages\pandas\io\common.py&quot;, line 434, in get_handle
      f = open(path_or_buf, mode)
  FileNotFoundError: [Errno 2] No such file or directory: 'GBPUSD=X_data.pkl'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;C:/Users/cinji/PycharmProjects/LearnAlgorithmicTrading/StatArb.py&quot;, line 18, in &lt;module&gt;
      data = data.DataReader(symbol, 'yahoo', START_DATE, END_DATE)
    File &quot;C:\Users\cinji\PycharmProjects\LearnAlgorithmicTrading\venv\lib\site-packages\pandas\core\generic.py&quot;, line 5274, in __getattr__
      return object.__getattribute__(self, name)
  AttributeError: 'DataFrame' object has no attribute 'DataReader'
  
  Process finished with exit code 1
  </code></pre>
  <p>When I run the file that came with the purchase of the book, the same error is produced.  I googled and checked for solutions, but have not found one.</p>
  <p>I have also checked Yahoo in case it changed the symbol for currency, but it doesn't look like any changes have been made.</p>
  <p>Any help would be great.</p>
  <p>Thank you.</p>