@@ -60,22 +60,22 @@ Yahoo! Finance Options
60
60
61
61
The Options class allows the download of options data from Yahoo! Finance.
62
62
63
- The '' get_all_data'' method downloads and caches option data for all expiry months
64
- and provides a formatted '' DataFrame'' with a hierarchical index, so its easy to get
63
+ The `` get_all_data `` method downloads and caches option data for all expiry months
64
+ and provides a formatted `` DataFrame `` with a hierarchical index, so its easy to get
65
65
to the specific option you want.
66
66
67
67
.. ipython :: python
68
68
69
69
from pandas.io.data import Options
70
70
aapl = Options(' aapl' , ' yahoo' )
71
71
data = aapl.get_all_data()
72
- data.head()
72
+ data.iloc[ 0 : 5 :, 0 : 5 ]
73
73
74
- # Show the $600 strike puts at all expiry dates:
75
- data.loc[(600 , slice (None ), ' put' ),:].head()
74
+ # Show the $100 strike puts at all expiry dates:
75
+ data.loc[(100 , slice (None ), ' put' ),:].iloc[ 0 : 5 :, 0 : 5 ]
76
76
77
- # Show the volume traded of $600 strike puts at all expiry dates:
78
- data.loc[(600 , slice (None ), ' put' ),' Vol' ].head()
77
+ # Show the volume traded of $100 strike puts at all expiry dates:
78
+ data.loc[(100 , slice (None ), ' put' ),' Vol' ].iloc[ 0 : 5 :, 0 : 5 ]
79
79
80
80
If you don't want to download all the data, more specific requests can be made.
81
81
@@ -84,9 +84,9 @@ If you don't want to download all the data, more specific requests can be made.
84
84
import datetime
85
85
expiry = datetime.date(2016 , 1 , 1 )
86
86
data = aapl.get_call_data(expiry = expiry)
87
- data.head()
87
+ data.iloc[ 0 : 5 :, 0 : 5 ]
88
88
89
- Note that if you call '' get_all_data'' first, this second call will happen much faster, as the data is cached.
89
+ Note that if you call `` get_all_data `` first, this second call will happen much faster, as the data is cached.
90
90
91
91
92
92
.. _remote_data.google :
0 commit comments