0

I followed the example code from this link: https://pandas-datareader.readthedocs.io/en/latest/remote_data.html#google-finance, and it throws an error.

This is the error:

RemoteDataError: Unable to read URL: http://www.google.com/finance/historical?q=F&startdate=Jan+01%2C+2010&enddate=Jan+27%2C+2013&output=csv

Is this method now broken or something? This was working fine yesterday.

Allen L.
  • 21
  • 3
  • can you post an output of `pd.show_versions()`? It works fine for me: pandas_datareader: 0.5.0, pandas: 0.20.1 – MaxU - stand with Ukraine Aug 14 '17 at 11:48
  • Using pandas: 0.19.2 and pandas_datareader: 0.5.0. I used pip3 install --upgrade pandas to try to get latest version, but for some reason jupyter is still using pandas 0.19.2. – Allen L. Aug 14 '17 at 12:04
  • Nevermind forgot to restart my notebook. I needed to upgrade my pandas version. Thank you! – Allen L. Aug 14 '17 at 12:07

2 Answers2

1

I think this issue was raised in GitHub.

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

It looks like Google has changed it's Finance Webpage URL.

There is a fix suggested in the link above that works for me.

J100
  • 3,896
  • 2
  • 11
  • 18
0

Until the bug is fixed You may want to use yahoo finance API instead. You'll need to get it first by:

pip install fix-yahoo-finance.

ex.py:

#imports

import pandas as pd
pd.core.common.is_list_like = pd.api.types.is_list_like
from pandas_datareader import data, wb
import fix_yahoo_finance as yf
yf.pdr_override()
import numpy as np
import datetime

#To get data:

start = datetime.datetime(2006, 1, 1)
end = datetime.datetime(2016, 1, 1)
df = data.get_data_yahoo('MS', start, end)
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
LucyDrops
  • 539
  • 5
  • 15