Skip to content

Commit 4e49363

Browse files
sglyony-p
authored and
y-p
committed
BUG: in data.io.options.get_forward_data for puts
1 parent 8ab4541 commit 4e49363

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/io/data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,12 +870,11 @@ def get_forward_data(self, months, call=True, put=False, near=False,
870870
if put:
871871
all_puts = DataFrame()
872872
for mon in range(months):
873+
m2 = in_months[mon]
874+
y2 = in_years[mon]
873875
try: # This catches cases when there isn't data for a month
874876
if not near:
875877
try: # Try to access the ivar if already instantiated
876-
m2 = in_months[mon]
877-
y2 = in_years[mon]
878-
879878
m1 = m2 if len(str(m2)) == 2 else '0' + str(m2)
880879
name = 'puts' + str(m1) + str(y2)[2:]
881880
put_frame = self.__getattribute__(name)
@@ -886,7 +885,8 @@ def get_forward_data(self, months, call=True, put=False, near=False,
886885
else:
887886
put_frame = self.get_near_stock_price(call=False,
888887
put=True,
889-
above_below=above_below)
888+
above_below=above_below,
889+
month=m2, year=y2)
890890

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

0 commit comments

Comments
 (0)