Skip to content

BUG: Fix pandas.io.data.Options for change in format of Yahoo Option page #8631

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

Merged
merged 2 commits into from
Nov 5, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion doc/source/remote_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,27 @@ If you don't want to download all the data, more specific requests can be made.
data = aapl.get_call_data(expiry=expiry)
data.iloc[0:5:, 0:5]

Note that if you call ``get_all_data`` first, this second call will happen much faster, as the data is cached.
Note that if you call ``get_all_data`` first, this second call will happen much faster,
as the data is cached.

If a given expiry date is not available, data for the next available expiry will be
returned (January 15, 2015 in the above example).

Available expiry dates can be accessed from the ``expiry_dates`` property.

.. ipython:: python

aapl.expiry_dates
data = aapl.get_call_data(expiry=aapl.expiry_dates[0])
data.iloc[0:5:, 0:5]

A list-like object containing dates can also be passed to the expiry parameter,
returning options data for all expiry dates in the list.

.. ipython:: python

data = aapl.get_near_stock_price(expiry=aapl.expiry_dates[0:3])
data.iloc[0:5:, 0:5]

.. _remote_data.google:

Expand Down
33 changes: 33 additions & 0 deletions doc/source/whatsnew/v0.15.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,39 @@ API changes

- added Index properties `is_monotonic_increasing` and `is_monotonic_decreasing` (:issue:`8680`).

.. note:: io.data.Options has been fixed for a change in the format of the Yahoo Options page (:issue:`8612`)

As a result of a change in Yahoo's option page layout, when an expiry date is given,
``Options`` methods now return data for a single expiry date. Previously, methods returned all
data for the selected month.

The ``month`` and ``year`` parameters have been undeprecated and can be used to get all
options data for a given month.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add this to the docs in remote_data.rst (the fact that this is possible, not that it is undeprecated).


If an expiry date that is not valid is given, data for the next expiry after the given
date is returned.

Option data frames are now saved on the instance as ``callsYYMMDD`` or ``putsYYMMDD``. Previously
they were saved as ``callsMMYY`` and ``putsMMYY``. The next expiry is saved as ``calls`` and ``puts``.

New features:

The expiry parameter can now be a single date or a list-like object containing dates.

A new property ``expiry_dates`` was added, which returns all available expiry dates.

current behavior:

.. ipython:: python

from pandas.io.data import Options
aapl = Options('aapl','yahoo')
aapl.get_call_data().iloc[0:5,0:1]
aapl.expiry_dates
aapl.get_near_stock_price(expiry=aapl.expiry_dates[0:3]).iloc[0:5,0:1]

See the Options documentation in :ref:`Remote Data <remote_data.yahoo_options>`

.. _whatsnew_0151.enhancements:

Enhancements
Expand Down
Loading