Skip to content

Instantly share code, notes, and snippets.

@tshauck
Last active September 19, 2015 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tshauck/44e8d4ecc5e4a9565744 to your computer and use it in GitHub Desktop.
Save tshauck/44e8d4ecc5e4a9565744 to your computer and use it in GitHub Desktop.
pandas-calendar.py
"""
Created By: Trent Hauck
Date: 2015-09-18T21:52:35
License: Use the shit out of it.
"""
# pylint: disable=no-init, too-few-public-methods
from pandas.tseries import holiday as h
from pandas.tseries import offsets as o
class BusinessCalendar(h.AbstractHolidayCalendar):
""" Basic business calendar. """
rules = [
h.Holiday("Thanksgiving's Friday.", month=11, day=1, offset=o.DateOffset(weekday=h.FR(4)))
]
rules.extend(h.USFederalHolidayCalendar.rules)
def main():
""" My main thing. """
calendar = BusinessCalendar()
print calendar
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment