-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
local variable 'rs' referenced before assignment error #9991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is fixed in pandas-datareader: https://github.com/pydata/pandas-datareader. It should be good in version 0.1.1 |
After installing pandas_datareader it with pip: In [1]: import pandas_datareader.data as web In [2]: import datetime In [3]: start = datetime.datetime(2010, 1, 1) In [4]: end = datetime.datetime(2013, 1, 27) In [5]: f = web.DataReader("F", 'yahoo', start, end) IOError: after 3 tries, Yahoo! did not return a 200 for url 'http://ichart.finance.yahoo.com/table.csv?s=F&a=0&b=1&c=2010&d=0&e=27&f=2013&g=d&ignore=.csv' do I missing something? |
This looks like a problem outside of pandas (are you behind a proxy / firewall?). Try this directly:
If that doesn't work, then the problem is just that your machine can't connect to yahoo. |
I don't have a proxy/firewall that I am aware of, I can download the file directly... and also I tried with another network and I Have the same following 404 error: In [8]: urllib2.urlopen('http://ichart.finance.yahoo.com/table.csv?s=F&a=0&b=1&c=2010&d=0&e=27&f=201=d&ignore=.csv')HTTPError Traceback (most recent call last) /home/german/anaconda/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout, cafile, capath, cadefault, context) /home/german/anaconda/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout) /home/german/anaconda/lib/python2.7/urllib2.pyc in http_response(self, request, response) /home/german/anaconda/lib/python2.7/urllib2.pyc in error(self, proto, _args) /home/german/anaconda/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, _args) /home/german/anaconda/lib/python2.7/urllib2.pyc in http_error_default(self, req, fp, code, msg, hdrs) HTTPError: HTTP Error 404: Not Found |
fixed here pydata/pandas-datareader#25 |
Hope you can help with the following error (thanks):
(with any financial data source, after I upgraded to v0.16 because yahoo finance was not working 0.14)
$goog=web.DataReader('GOOG', data_source='google', start='3/14/2009', end = '4/14/2014')
anaconda/lib/python2.7/site-packages/pandas/io/data.pyc in _retry_read_url(url, retry_count, pause, name)
175 #Get rid of unicode characters in index name.
176 try:
--> 177 rs.index.name = rs.index.name.decode('unicode_escape').encode('ascii', 'ignore')
178 except AttributeError:
179 #Python 3 string has no decode method.
UnboundLocalError: local variable 'rs' referenced before assignment
In [33]: pd.version
Out[33]: '0.16.0'
The text was updated successfully, but these errors were encountered: