0

Does pandas bdate_range doesn't recognize Memorial Day as a holiday or am I reading this incorrectly? May 28, 2012 was Memorial day.

I get the same result for 2010 and 2011.

EDIT: I'm using python version 2.7.3 and pandas version 0.13.0

In [215]: t = pd.bdate_range('2012-05-01','2012-05-31')

In [216]: t
Out[216]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-05-01 00:00:00, ..., 2012-05-31 00:00:00]
Length: 23, Freq: B, Timezone: None

In [217]: t.date
Out[217]: 
array([datetime.date(2012, 5, 1), datetime.date(2012, 5, 2),
       datetime.date(2012, 5, 3), datetime.date(2012, 5, 4),
       datetime.date(2012, 5, 7), datetime.date(2012, 5, 8),
       datetime.date(2012, 5, 9), datetime.date(2012, 5, 10),
       datetime.date(2012, 5, 11), datetime.date(2012, 5, 14),
       datetime.date(2012, 5, 15), datetime.date(2012, 5, 16),
       datetime.date(2012, 5, 17), datetime.date(2012, 5, 18),
       datetime.date(2012, 5, 21), datetime.date(2012, 5, 22),
       datetime.date(2012, 5, 23), datetime.date(2012, 5, 24),
       datetime.date(2012, 5, 25), datetime.date(2012, 5, 28),
       datetime.date(2012, 5, 29), datetime.date(2012, 5, 30),
       datetime.date(2012, 5, 31)], dtype=object)
EdChum
  • 376,765
  • 198
  • 813
  • 562
henny.mcil
  • 11
  • 5
  • 1
    I believe this is to be expected as national holidays vary considerably, you would need to define them yourself see related: http://stackoverflow.com/questions/2394235/detecting-a-us-holiday and also this: http://stackoverflow.com/questions/2224742/business-days-in-python – EdChum Mar 03 '14 at 22:23
  • 3
    business date is just mon-fri, not holidays at all. you *can* use a CustomBuisinessDay to do that. – Jeff Mar 03 '14 at 22:58

0 Answers0