Skip to content

DOC: Added note about changes in Options class to 'what's new' v 0.11 #2884

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
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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/v0.11.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ While float dtypes are unchanged.
Datetimes Conversion
~~~~~~~~~~~~~~~~~~~~

Datetime64[ns] columns in a DataFrame (or a Series) allow the use of ``np.nan`` to indicate a nan value,
Datetime64[ns] columns in a DataFrame (or a Series) allow the use of ``np.nan`` to indicate a nan value,
in addition to the traditional ``NaT``, or not-a-time. This allows convenient nan setting in a generic way.
Furthermore ``datetime64[ns]`` columns are created by default, when passed datetimelike objects (*this change was introduced in 0.10.1*)
(GH2809_, GH2810_)
Expand Down Expand Up @@ -159,6 +159,25 @@ New features
p.reindex(items=['ItemA']).squeeze()
p.reindex(items=['ItemA'],minor=['B']).squeeze()

- In ``pd.io.data.Options``,

+ Fix bug when trying to fetch data for the current month when already
past expiry.
+ Now using lxml to scrape html instead of BeautifulSoup (lxml was faster).
+ New instance variables for calls and puts are automatically created
when a method that creates them is called. This works for current month
where the instance variables are simply ``calls`` and ``puts``. Also
works for future expiry months and save the instance variable as
``callsMMYY`` or ``putsMMYY``, where ``MMYY`` are, respectively, the
month and year of the option's expiry.
+ ``Options.get_near_stock_price`` now allows the user to specify the
month for which to get relevant options data.
+ ``Options.get_forward_data`` now has optional kwargs ``near`` and
``above_below``. This allows the user to specify if they would like to
only return forward looking data for options near the current stock
price. This just obtains the data from Options.get_near_stock_price
instead of Options.get_xxx_data().

**Bug Fixes**

See the `full release notes
Expand Down
8 changes: 4 additions & 4 deletions pandas/io/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,11 @@ def get_forward_data(self, months, call=True, put=False, near=False,
if put:
all_puts = DataFrame()
for mon in range(months):
m2 = in_months[mon]
y2 = in_years[mon]
try: # This catches cases when there isn't data for a month
if not near:
try: # Try to access the ivar if already instantiated
m2 = in_months[mon]
y2 = in_years[mon]

m1 = m2 if len(str(m2)) == 2 else '0' + str(m2)
name = 'puts' + str(m1) + str(y2)[2:]
put_frame = self.__getattribute__(name)
Expand All @@ -886,7 +885,8 @@ def get_forward_data(self, months, call=True, put=False, near=False,
else:
put_frame = self.get_near_stock_price(call=False,
put=True,
above_below=above_below)
above_below=above_below,
month=m2, year=y2)

# Add column with expiry data to this frame.
tick = str(put_frame.Symbol[0])
Expand Down