Skip to content

Having weird issues with the data reader fetching yahoo finance #332

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

Closed
xrlu0929 opened this issue May 17, 2017 · 3 comments
Closed

Having weird issues with the data reader fetching yahoo finance #332

xrlu0929 opened this issue May 17, 2017 · 3 comments

Comments

@xrlu0929
Copy link

`import pandas_datareader as pdr
import pandas as pd

import matplotlib.pyplot as plt

import datetime as dt
start_date = dt.datetime(2016,1,1)
end_date = dt.datetime(2016,12,31)
df_bit = pdr.get_data_yahoo('GBTC', start_date, end_date)
df_gd = pdr.get_data_yahoo('IAU', start_date, end_date)
df_com = pdr.get_data_yahoo('IYZ', start_date, end_date)
df_bio = pdr.get_data_yahoo('RYOIX', start_date, end_date)
df_tao = pdr.get_data_yahoo('TAO', start_date, end_date)
df_sp = pdr.get_data_yahoo('^GSPC', start_date, end_date)`

Then it returns:
`---------------------------------------------------------------------------
RemoteDataError Traceback (most recent call last)
in ()
----> 1 df_bit = pdr.get_data_yahoo('GBTC', start_date, end_date)
2 df_gd = pdr.get_data_yahoo('IAU', start_date, end_date)
3 df_com = pdr.get_data_yahoo('IYZ', start_date, end_date)
4 df_bio = pdr.get_data_yahoo('RYOIX', start_date, end_date)
5 df_tao = pdr.get_data_yahoo('TAO', start_date, end_date)

/Users/annaxlu/anaconda3/lib/python3.6/site-packages/pandas_datareader/data.py in get_data_yahoo(*args, **kwargs)
38
39 def get_data_yahoo(*args, **kwargs):
---> 40 return YahooDailyReader(*args, **kwargs).read()
41
42

/Users/annaxlu/anaconda3/lib/python3.6/site-packages/pandas_datareader/yahoo/daily.py in read(self)
74 def read(self):
75 """ read one data from specified URL """
---> 76 df = super(YahooDailyReader, self).read()
77 if self.ret_index:
78 df['Ret_Index'] = _calc_return_index(df['Adj Close'])

/Users/annaxlu/anaconda3/lib/python3.6/site-packages/pandas_datareader/base.py in read(self)
153 # If a single symbol, (e.g., 'GOOG')
154 if isinstance(self.symbols, (compat.string_types, int)):
--> 155 df = self._read_one_data(self.url, params=self._get_params(self.symbols))
156 # Or multiple symbols, (e.g., ['GOOG', 'AAPL', 'MSFT'])
157 elif isinstance(self.symbols, DataFrame):

/Users/annaxlu/anaconda3/lib/python3.6/site-packages/pandas_datareader/base.py in _read_one_data(self, url, params)
72 """ read one data from specified URL """
73 if self._format == 'string':
---> 74 out = self._read_url_as_StringIO(url, params=params)
75 elif self._format == 'json':
76 out = self._get_response(url, params=params).json()

/Users/annaxlu/anaconda3/lib/python3.6/site-packages/pandas_datareader/base.py in _read_url_as_StringIO(self, url, params)
83 Open url (and retry)
84 """
---> 85 response = self._get_response(url, params=params)
86 text = self._sanitize_response(response)
87 out = StringIO()

/Users/annaxlu/anaconda3/lib/python3.6/site-packages/pandas_datareader/base.py in _get_response(self, url, params)
118 if params is not None and len(params) > 0:
119 url = url + "?" + urlencode(params)
--> 120 raise RemoteDataError('Unable to read URL: {0}'.format(url))
121
122 def _read_lines(self, out):

RemoteDataError: Unable to read URL: http://ichart.finance.yahoo.com/table.csv?s=GBTC&a=0&b=1&c=2016&d=11&e=31&f=2016&g=d&ignore=.csv
`

@rgkimball
Copy link
Contributor

You're not alone... see #315, #330 and PR #331

@xrlu0929
Copy link
Author

@rgkimball Oh My.... I've tried searching for new tickers, and even restart...but no.. It worked yesterday, just today when I wanted to look into some issues to finalize it, then it shows like this!
Thanks, I'll go and see the issues you mentioned to try luck.

@jreback
Copy link
Contributor

jreback commented Jul 2, 2017

dupe of #315

@jreback jreback closed this as completed Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants