From 3d6fdc07555dc0b1393849288f2bb0b2ea1bb936 Mon Sep 17 00:00:00 2001 From: Jean Bredeche Date: Wed, 13 Jul 2016 20:40:57 -0400 Subject: [PATCH] Make sure we are passing ints to nth. --- zipline/utils/events.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zipline/utils/events.py b/zipline/utils/events.py index abdc3506..df3cd18c 100644 --- a/zipline/utils/events.py +++ b/zipline/utils/events.py @@ -412,7 +412,7 @@ class TradingDayOfWeekRule(six.with_metaclass(ABCMeta, StatelessRule)): # calculate the list of periods that match the given criteria return self.cal.schedule.groupby( pd.Grouper(freq="W") - ).nth(self.td_delta).index + ).nth(int(self.td_delta)).index def should_trigger(self, dt): # is this market minute's period in the list of execution periods? @@ -456,7 +456,7 @@ class TradingDayOfMonthRule(six.with_metaclass(ABCMeta, StatelessRule)): # calculate the list of periods that match the given criteria return self.cal.schedule.groupby( pd.Grouper(freq="M") - ).nth(self.td_delta).index + ).nth(int(self.td_delta)).index class NthTradingDayOfMonth(TradingDayOfMonthRule):