本文整理汇总了Python中dateutil.rrule.FR属性的典型用法代码示例。如果您正苦于以下问题:Python rrule.FR属性的具体用法?Python rrule.FR怎么用?Python rrule.FR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类dateutil.rrule
的用法示例。
在下文中一共展示了rrule.FR属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRRuleAll
# 需要导入模块: from dateutil import rrule [as 别名]
# 或者: from dateutil.rrule import FR [as 别名]
def testRRuleAll(self):
from dateutil.rrule import rrule
from dateutil.rrule import rruleset
from dateutil.rrule import rrulestr
from dateutil.rrule import YEARLY, MONTHLY, WEEKLY, DAILY
from dateutil.rrule import HOURLY, MINUTELY, SECONDLY
from dateutil.rrule import MO, TU, WE, TH, FR, SA, SU
rr_all = (rrule, rruleset, rrulestr,
YEARLY, MONTHLY, WEEKLY, DAILY,
HOURLY, MINUTELY, SECONDLY,
MO, TU, WE, TH, FR, SA, SU)
for var in rr_all:
self.assertIsNot(var, None)
# In the public interface but not in all
from dateutil.rrule import weekday
self.assertIsNot(weekday, None)
示例2: testRelativeDeltaAll
# 需要导入模块: from dateutil import rrule [as 别名]
# 或者: from dateutil.rrule import FR [as 别名]
def testRelativeDeltaAll(self):
from dateutil.relativedelta import relativedelta
from dateutil.relativedelta import MO, TU, WE, TH, FR, SA, SU
for var in (relativedelta, MO, TU, WE, TH, FR, SA, SU):
self.assertIsNot(var, None)
# In the public interface but not in all
from dateutil.relativedelta import weekday
self.assertIsNot(weekday, None)
示例3: get_early_closes
# 需要导入模块: from dateutil import rrule [as 别名]
# 或者: from dateutil.rrule import FR [as 别名]
def get_early_closes(start, end):
# TSX closed at 1:00 PM on december 24th.
start = canonicalize_datetime(start)
end = canonicalize_datetime(end)
start = max(start, datetime(1993, 1, 1, tzinfo=pytz.utc))
end = max(end, datetime(1993, 1, 1, tzinfo=pytz.utc))
# Not included here are early closes prior to 1993
# or unplanned early closes
early_close_rules = []
christmas_eve = rrule.rrule(
rrule.MONTHLY,
bymonth=12,
bymonthday=24,
byweekday=(rrule.MO, rrule.TU, rrule.WE, rrule.TH, rrule.FR),
cache=True,
dtstart=start,
until=end
)
early_close_rules.append(christmas_eve)
early_close_ruleset = rrule.rruleset()
for rule in early_close_rules:
early_close_ruleset.rrule(rule)
early_closes = early_close_ruleset.between(start, end, inc=True)
early_closes.sort()
return pd.DatetimeIndex(early_closes)
示例4: init_rruleset
# 需要导入模块: from dateutil import rrule [as 别名]
# 或者: from dateutil.rrule import FR [as 别名]
def init_rruleset():
rr = rruleset()
rr.rrule(rrule(DAILY,
byweekday=(MO,TU,WE,TH,FR),
dtstart=datetime.datetime(2010,1,1)))
for h in holidays:
rr.exdate(h)
return rr
示例5: __init__
# 需要导入模块: from dateutil import rrule [as 别名]
# 或者: from dateutil.rrule import FR [as 别名]
def __init__(self):
BaseCalendarTest.__init__(self)
self.cal = Calendar()
rr = rruleset()
rr.rrule(rrule(DAILY,
byweekday=(MO,TU,WE,TH,FR),
dtstart=datetime.datetime(2010,1,1)))
self.rr = rr
self.dates = rr.between(datetime.datetime(2010,1,1),
datetime.datetime(2013,12,31),
inc=True)