Skip to content

.get_all_data() for Options fails if either puts or calls have no data #11395

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
dscheste opened this issue Oct 21, 2015 · 3 comments
Closed
Labels
Deprecate Functionality to remove in pandas

Comments

@dscheste
Copy link

While invoking .get_all_data() and collecting options data for all strikes and expirations the entire dataframe errors out as soon as the parser comes across an expiration chain where data is only available for one type (calls or puts) and not both.

For example:

new_data=pd.DataFrame()
option = Options('AA', 'yahoo')
data = option.get_all_data()

Crashes with:

File "/usr/lib/python2.7/dist-packages/pandas/io/data.py", line 1139, in get_all_data
return self._get_data_in_date_range(dates=expiry_dates, call=call, put=put)
File "/usr/lib/python2.7/dist-packages/pandas/io/data.py", line 1153, in _get_data_in_date_range
frame = self._get_option_data(expiry=expiry_date, name=name)
File "/usr/lib/python2.7/dist-packages/pandas/io/data.py", line 771, in _get_option_data
frames = self._get_option_frames_from_yahoo(expiry)
File "/usr/lib/python2.7/dist-packages/pandas/io/data.py", line 688, in _get_option_frames_from_yahoo
option_frames = self._option_frames_from_url(url)
File "/usr/lib/python2.7/dist-packages/pandas/io/data.py", line 725, in _option_frames_from_url
raise RemoteDataError('Received no data from Yahoo at url: %s' % url)
pandas.io.data.RemoteDataError: Received no data from Yahoo at url: http://finance.yahoo.com/q/op?s=AA&date=1450396800

Since about half tickers have such chains, pulling data reliably is a challenge.

Python 2.7.9
Pandas was installed through pip
Ubuntu 15.04

pip shows pandas:

Name: pandas
Version: 0.15.0
Location: /usr/lib/python2.7/dist-packages
Requires: python-dateutil, pytz, numpy

~$ pip show pandas-datareader

Name: pandas-datareader
Version: 0.2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: pandas

@jreback
Copy link
Contributor

jreback commented Oct 21, 2015

@dscheste you have a pretty old version of pandas, current in 0.17.0

DataReader has been deprecated and is supported here

I believe this is your issue anyhow: pydata/pandas-datareader#22

@jreback jreback closed this as completed Oct 21, 2015
@jreback jreback added Data Reader Deprecate Functionality to remove in pandas labels Oct 21, 2015
@dscheste
Copy link
Author

Thank you for the info, is there an easy way to upgrade from v15 to latest on Ubuntu? pip --upgrade pandas keeps pushing v15.

@jreback
Copy link
Contributor

jreback commented Oct 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

No branches or pull requests

2 participants