Skip to content

Commit

Permalink
Merge pull request #5602 from dstephens99/master
Browse files Browse the repository at this point in the history
ENH: Added method to pandas.data.Options to download all option data for...
  • Loading branch information
jreback committed Jun 17, 2014
2 parents 7a2db77 + 2ba5ead commit 70baac7
Show file tree
Hide file tree
Showing 7 changed files with 1,154 additions and 104 deletions.
4 changes: 4 additions & 0 deletions doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ performance improvements along with a large number of bug fixes.

Highlights include:

Experimental Features
~~~~~~~~~~~~~~~~~~~~~
- ``pandas.io.data.Options`` has a get_all_data method and now consistently returns a multi-indexed ''DataFrame'' (:issue:`5602`)

See the :ref:`v0.14.1 Whatsnew <whatsnew_0141>` overview or the issue tracker on GitHub for an extensive list
of all API changes, enhancements and bugs that have been fixed in 0.14.1.

Expand Down
37 changes: 37 additions & 0 deletions doc/source/remote_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,43 @@ Yahoo! Finance
f=web.DataReader("F", 'yahoo', start, end)
f.ix['2010-01-04']
.. _remote_data.yahoo_Options:

Yahoo! Finance Options
----------------------
***Experimental***

The Options class allows the download of options data from Yahoo! Finance.

The ''get_all_data'' method downloads and caches option data for all expiry months
and provides a formatted ''DataFrame'' with a hierarchical index, so its easy to get
to the specific option you want.

.. ipython:: python
from pandas.io.data import Options
aapl = Options('aapl', 'yahoo')
data = aapl.get_all_data()
data.head()
#Show the $600 strike puts at all expiry dates:
data.loc[(600, slice(None), 'put'),:].head()
#Show the volume traded of $600 strike puts at all expiry dates:
data.loc[(600, slice(None), 'put'),'Vol'].head()
If you don't want to download all the data, more specific requests can be made.

.. ipython:: python
import datetime
expiry = datetime.date(2016, 1, 1)
data = aapl.get_call_data(expiry=expiry)
data.head()
Note that if you call ''get_all_data'' first, this second call will happen much faster, as the data is cached.


.. _remote_data.google:

Google Finance
Expand Down
18 changes: 17 additions & 1 deletion doc/source/v0.14.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,23 @@ Performance
Experimental
~~~~~~~~~~~~

There are no experimental changes in 0.14.1
``pandas.io.data.Options`` has a get_all_data method and now consistently returns a multi-indexed ''DataFrame'' (PR `#5602`)
See :ref:`the docs<remote_data.yahoo_Options>` ***Experimental***

.. ipython:: python

from pandas.io.data import Options
aapl = Options('aapl', 'yahoo')
data = aapl.get_all_data()
data.head()

.. ipython:: python

from pandas.io.data import Options
aapl = Options('aapl', 'yahoo')
data = aapl.get_all_data()
data.head()


.. _whatsnew_0141.bug_fixes:

Expand Down
Loading

0 comments on commit 70baac7

Please sign in to comment.