Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The use of USFederalHolidayCalendar will result in incorrect behavior #10278

Closed
clearf opened this issue Jun 4, 2015 · 5 comments
Closed

The use of USFederalHolidayCalendar will result in incorrect behavior #10278

clearf opened this issue Jun 4, 2015 · 5 comments
Labels
Bug Frequency DateOffsets

Comments

@clearf
Copy link
Contributor

clearf commented Jun 4, 2015

The definition of the USFederalHolidayCalendar is not correct.

from pandas.tseries.holiday import USFederalHolidayCalendar
print(USFederalHolidayCalendar.rules)

[Holiday: New Years Day (month=1, day=1, observance=<function nearest_workday at 0x10d17dcf8>), Holiday: Dr. Martin Luther King Jr. (month=1, day=1, offset=<DateOffset: kwds={'weekday': MO(+3)}>), Holiday: Presidents Day (month=2, day=1, offset=<DateOffset: kwds={'weekday': MO(+3)}>), Holiday: MemorialDay (month=5, day=24, offset=<DateOffset: kwds={'weekday': MO(+1)}>), Holiday: July 4th (month=7, day=4, observance=<function nearest_workday at 0x10d17dcf8>), Holiday: Labor Day (month=9, day=1, offset=<DateOffset: kwds={'weekday': MO(+1)}>), Holiday: Columbus Day (month=10, day=1, offset=<DateOffset: kwds={'weekday': MO(+2)}>), Holiday: Veterans Day (month=11, day=11, observance=<function nearest_workday at 0x10d17dcf8>), Holiday: Thanksgiving (month=11, day=1, offset=<DateOffset: kwds={'weekday': TH(+4)}>), Holiday: Christmas (month=12, day=25, observance=<function nearest_workday at 0x10d17dcf8>)]

print(USFederalHolidayCalendar.start_date)

1970-01-01 00:00:00

But Martin Luther King Day was first observed in 1986, so the holiday is being applied inappropriately before then. I am going to work on a snippet for a correct US holiday calendar.

@rockg
Copy link
Contributor

rockg commented Jun 4, 2015

Should be as easy as passing in start_date to the Holiday definition.

@OmerJog
Copy link

OmerJog commented Dec 2, 2019

This is still an issue on master

@jreback
Copy link
Contributor

jreback commented Dec 2, 2019

@OmerJog hence the open tag

you are welcome to submit a patch

@mroeschke mroeschke added Frequency DateOffsets and removed Datetime Datetime data dtype labels Mar 31, 2020
@roadswitcher
Copy link
Contributor

Should this be closed?
Per the comments on #10282, it looks like @clearf fixed it when 8ccdf48 was merged

@mroeschke
Copy link
Member

Yes this looks fixed. Thanks for identifying. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets
Projects
None yet
Development

No branches or pull requests

6 participants