File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ Bug Fixes
87
87
- Bug when assigning to .ix[tuple(...)] (:issue: `5896 `)
88
88
- Bug in fully reindexing a Panel (:issue: `5905 `)
89
89
- Bug in idxmin/max with object dtypes (:issue: `5914 `)
90
+ - Bug in ``BusinessDay `` when adding n days to a date not on offset when n>5 and n%5==0 (:issue: `5890 `)
90
91
91
92
pandas 0.13.0
92
93
-------------
Original file line number Diff line number Diff line change @@ -397,7 +397,9 @@ def apply(self, other):
397
397
if n < 0 and result .weekday () > 4 :
398
398
n += 1
399
399
n -= 5 * k
400
-
400
+ if n == 0 and result .weekday () > 4 :
401
+ n -= 1
402
+
401
403
while n != 0 :
402
404
k = n // abs (n )
403
405
result = result + timedelta (k )
Original file line number Diff line number Diff line change @@ -317,6 +317,11 @@ def test_apply_large_n(self):
317
317
rs = st + off
318
318
xp = datetime (2011 , 12 , 26 )
319
319
self .assertEqual (rs , xp )
320
+
321
+ off = BDay () * 10
322
+ rs = datetime (2014 , 1 , 5 ) + off # see #5890
323
+ xp = datetime (2014 , 1 , 17 )
324
+ self .assertEqual (rs , xp )
320
325
321
326
def test_apply_corner (self ):
322
327
self .assertRaises (TypeError , BDay ().apply , BMonthEnd ())
You can’t perform that action at this time.
0 commit comments