本文整理汇总了Python中pandas.tseries.holiday.AbstractHolidayCalendar方法的典型用法代码示例。如果您正苦于以下问题:Python holiday.AbstractHolidayCalendar方法的具体用法?Python holiday.AbstractHolidayCalendar怎么用?Python holiday.AbstractHolidayCalendar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.tseries.holiday
的用法示例。
在下文中一共展示了holiday.AbstractHolidayCalendar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
# The CME has different holiday rules depending on the type of
# instrument. For example, http://www.cmegroup.com/tools-information/holiday-calendar/files/2016-4th-of-july-holiday-schedule.pdf # noqa
# shows that Equity, Interest Rate, FX, Energy, Metals & DME Products
# close at 1200 CT on July 4, 2016, while Grain, Oilseed & MGEX
# Products and Livestock, Dairy & Lumber products are completely
# closed.
# For now, we will treat the CME as having a single calendar, and just
# go with the most conservative hours - and treat July 4 as an early
# close at noon.
return AbstractHolidayCalendar(rules=[
USNewYearsDay,
GoodFriday,
Christmas,
])
示例2: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
return AbstractHolidayCalendar(rules=[
ConfUniversal,
AniversarioSaoPaulo,
CarnavalSegunda,
CarnavalTerca,
SextaPaixao,
CorpusChristi,
Tiradentes,
DiaTrabalho,
Constitucionalista,
Independencia,
Aparecida,
Finados,
ProclamacaoRepublica,
ConscienciaNegra,
VesperaNatal,
Natal,
AnoNovo,
AnoNovoSabado,
])
示例3: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
"""
Returns
-------
pd.AbstractHolidayCalendar: a calendar containing the regular holidays
for this calendar
"""
return None
示例4: special_opens
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def special_opens(self):
"""
A list of special open times and corresponding HolidayCalendars.
Returns
-------
list: List of (time, AbstractHolidayCalendar) tuples
"""
return []
示例5: special_closes
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def special_closes(self):
"""
A list of special close times and corresponding HolidayCalendars.
Returns
-------
list: List of (time, AbstractHolidayCalendar) tuples
"""
return []
示例6: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
return AbstractHolidayCalendar(rules=[USNewYearsDay, Christmas])
示例7: special_opens
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def special_opens(self):
return [(time(11, 15), AbstractHolidayCalendar(rules=[MonTuesThursBeforeIndependenceDay]))]
示例8: special_closes
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def special_closes(self):
return [(time(11, 30), AbstractHolidayCalendar(rules=[MonTuesThursBeforeIndependenceDay]))]
示例9: special_closes
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def special_closes(self):
return [(
time(12),
AbstractHolidayCalendar(rules=[
USMartinLutherKingJrAfter1998,
USPresidentsDay,
USMemorialDay,
USLaborDay,
USIndependenceDay,
USThanksgivingDay,
USBlackFridayInOrAfter1993,
ChristmasEveBefore1993,
ChristmasEveInOrAfter1993,
])
)]
示例10: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
"""
Rules are guesses based on observations of recent year.
Rectify accordingly once the next year's holidays arrangement is published by the government.
"""
return AbstractHolidayCalendar(rules=[
HKNewYearsDay,
SpringFestivalDayBefore1983,
SpringFestivalDay2Before1983,
SpringFestivalDay3Before1983,
SpringFestivalDayBefore2010,
SpringFestivalDay2Before2010,
SpringFestivalDay3Before2010,
SpringFestivalDay,
SpringFestivalDay2,
SpringFestivalDay3,
GoodFriday,
EasterMonday,
TombSweepingDay,
LabourDay,
BuddhaShakyamuniDay,
DragonBoatFestivalDay,
HKRegionEstablishmentDay,
MidAutumnFestivalDayBefore1983,
MidAutumnFestivalDayBefore2010,
MidAutumnFestivalDay,
NationalDay,
DoubleNinthFestivalDay,
Christmas,
BoxingDay,
CommemoratingAlliedVictory,
QueenBirthday,
QueenBirthday2,
IDontKnow
])
示例11: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
return AbstractHolidayCalendar(rules=[
TSXNewYearsDay,
FamilyDay,
GoodFriday,
VictoriaDay,
CanadaDay,
CivicHoliday,
LaborDay,
Thanksgiving,
Christmas,
WeekendChristmas,
BoxingDay,
WeekendBoxingDay
])
示例12: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
return AbstractHolidayCalendar(rules=[
OSENewYearsDay,
OSEMaundyThursday,
OSEGoodFriday,
OSEEasterMonday,
OSELabourDay,
OSEConstitutionDay,
OSEWhitMonday,
OSEAscensionDay,
OSEChristmasEve,
OSEChristmasDay,
OSEBoxingDay,
OSENewYearsEve
])
示例13: regular_holidays
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def regular_holidays(self):
return AbstractHolidayCalendar(rules=[
EUREXNewYearsDay,
GoodFriday,
EasterMonday,
MayBank,
GermanNationalDay,
Christmas,
WeekendChristmas,
BoxingDay,
WeekendBoxingDay
])
示例14: special_closes
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def special_closes(self):
return [(
time(12, 30),
AbstractHolidayCalendar(rules=[
ChristmasEve,
EUREXNewYearsEve,
])
)]
示例15: special_closes
# 需要导入模块: from pandas.tseries import holiday [as 别名]
# 或者: from pandas.tseries.holiday import AbstractHolidayCalendar [as 别名]
def special_closes(self):
return [
(time(13), AbstractHolidayCalendar(rules=[
USMartinLutherKingJrAfter1998,
USPresidentsDay,
USMemorialDay,
USIndependenceDay,
USLaborDay,
USThanksgivingDay
]))
]