Skip to content

Commit da53d3f

Browse files
Fix for compatibility with numpy 1.15.0
np.busday_offset no longer automatically casts Timestamps so do this explicitly.
1 parent d831178 commit da53d3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

strategy/portfolios.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def rebalance_dates(self):
119119
rebal_dates = pd.DatetimeIndex(rebal_dates).unique().sort_values()
120120
rebal_dates = rebal_dates[rebal_dates >= self._start_date]
121121
rebal_dates = rebal_dates[rebal_dates <= self._end_date]
122-
first_date = np.busday_offset(self._start_date, 0, roll="following",
123-
holidays=holidays)
122+
first_date = np.busday_offset(self._start_date.date(), 0,
123+
roll="following", holidays=holidays)
124124
rebal_dates = rebal_dates.union([first_date])
125125

126126
return rebal_dates

0 commit comments

Comments
 (0)