A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/2680 below:

BDay() subtraction bug when the starting date is not on offset · Issue #2680 · pandas-dev/pandas · GitHub

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4