pandas-dev/pandas (original) (raw)

Note the output skips the weekday 12/23/2011.

dt = datetime(2012, 1, 1)

for i in range(1,10):
    print i, (dt - i * BDay()).strftime('%m/%d/%Y')

1 12/30/2011
2 12/29/2011
3 12/28/2011
4 12/27/2011
5 12/26/2011
6 12/22/2011
7 12/21/2011
8 12/20/2011
9 12/19/2011

however when the start date is onoffset it works fine

dt = datetime(2011, 12, 30)

for i in range(1, 10):
    print i, (dt - i * BDay()).strftime('%m/%d/%Y')

1 12/29/2011
2 12/28/2011
3 12/27/2011
4 12/26/2011
5 12/23/2011
6 12/22/2011
7 12/21/2011
8 12/20/2011
9 12/19/2011